From 20e0730f95aa871ff13959c05d082f4eeaf53507 Mon Sep 17 00:00:00 2001 From: cody <648753004@qq.com> Date: Mon, 11 Aug 2025 10:18:10 +0800 Subject: [PATCH] update --- app/Http/Controllers/Mobile/SupplyDemandController.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/Http/Controllers/Mobile/SupplyDemandController.php b/app/Http/Controllers/Mobile/SupplyDemandController.php index 3221734..f27a268 100755 --- a/app/Http/Controllers/Mobile/SupplyDemandController.php +++ b/app/Http/Controllers/Mobile/SupplyDemandController.php @@ -343,9 +343,11 @@ class SupplyDemandController extends CommonController return $this->fail([ResponseCode::ERROR_PARAMETER, implode(',', $validator->errors()->all())]); } // 获取会话id - $dialogue = Dialogue::where('user_id', $this->getUserId()) - ->where('to_user_id', $all['to_user_id']) - ->first(); + $dialogue = Dialogue::where(function ($query) use ($all) { + $query->where('user_id', $this->getUserId())->where('to_user_id', $all['to_user_id']); + })->orWhere(function ($query) use ($all) { + $query->where('user_id', $all['to_user_id'])->where('to_user_id', $this->getUserId()); + })->first(); if (empty($dialogue)) { return $this->fail([ResponseCode::ERROR_BUSINESS, '会话不存在']); }