|
|
|
|
@ -245,6 +245,10 @@ class SupplyDemandController extends CommonController
|
|
|
|
|
$query->where('user_id', $all['to_user_id'])->where('to_user_id', $this->getUserId());
|
|
|
|
|
})->first();
|
|
|
|
|
if (empty($dialogue)) {
|
|
|
|
|
// 不能给自己发信息
|
|
|
|
|
if ($all['to_user_id'] == $this->getUserId()) {
|
|
|
|
|
return $this->error('不能给自己发信息');
|
|
|
|
|
}
|
|
|
|
|
// 创建一条会话
|
|
|
|
|
$dialogue = Dialogue::create([
|
|
|
|
|
'user_id' => $this->getUserId(),
|
|
|
|
|
|