|
|
|
|
@ -236,10 +236,6 @@ class SupplyDemandController extends CommonController
|
|
|
|
|
if ($validator->fails()) {
|
|
|
|
|
return $this->fail([ResponseCode::ERROR_PARAMETER, implode(',', $validator->errors()->all())]);
|
|
|
|
|
}
|
|
|
|
|
if (isset($all['supply_demand_id']) && !empty($all['supply_demand_id'])) {
|
|
|
|
|
// 增加view_count
|
|
|
|
|
SupplyDemand::where('id', $all['supply_demand_id'])->increment('view_count');
|
|
|
|
|
}
|
|
|
|
|
// 判断是否有会话,没有则创建
|
|
|
|
|
$dialogue = Dialogue::where(function ($query) use ($all) {
|
|
|
|
|
$query->where('user_id', $this->getUserId())->where('to_user_id', $all['to_user_id']);
|
|
|
|
|
@ -253,6 +249,8 @@ class SupplyDemandController extends CommonController
|
|
|
|
|
'to_user_id' => $all['to_user_id'],
|
|
|
|
|
'supply_demand_id' => $all['supply_demand_id'] ?? 0
|
|
|
|
|
]);
|
|
|
|
|
// 增加联系次数
|
|
|
|
|
SupplyDemand::where('id', $all['supply_demand_id'])->increment('contact_count');
|
|
|
|
|
}
|
|
|
|
|
// 每天限制私信次数限制
|
|
|
|
|
$message_limit = Config::getValueByKey('message_limit');
|
|
|
|
|
|