master
cody 4 months ago
parent 5c0cd1efa8
commit dab03b75a9

@ -349,7 +349,11 @@ class SupplyDemandController extends CommonController
$query->where('user_id', $all['to_user_id'])->where('to_user_id', $this->getUserId()); $query->where('user_id', $all['to_user_id'])->where('to_user_id', $this->getUserId());
})->first(); })->first();
if (empty($dialogue)) { 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([ $message = Message::with([
'user' => function ($query) { 'user' => function ($query) {

Loading…
Cancel
Save