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) {