From dab03b75a960644fad8cae46e139b7f854159f52 Mon Sep 17 00:00:00 2001 From: cody <648753004@qq.com> Date: Mon, 18 Aug 2025 20:12:08 +0800 Subject: [PATCH] update --- app/Http/Controllers/Mobile/SupplyDemandController.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/Mobile/SupplyDemandController.php b/app/Http/Controllers/Mobile/SupplyDemandController.php index f27a268..92d0f3d 100755 --- a/app/Http/Controllers/Mobile/SupplyDemandController.php +++ b/app/Http/Controllers/Mobile/SupplyDemandController.php @@ -349,7 +349,11 @@ class SupplyDemandController extends CommonController $query->where('user_id', $all['to_user_id'])->where('to_user_id', $this->getUserId()); })->first(); if (empty($dialogue)) { - return $this->fail([ResponseCode::ERROR_BUSINESS, '会话不存在']); + // 创建一个会话 + $dialogue = Dialogue::create([ + 'user_id' => $this->getUserId(), + 'to_user_id' => $all['to_user_id'] + ]); } $message = Message::with([ 'user' => function ($query) {