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());
})->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) {

Loading…
Cancel
Save