From 0063d66b9d848b8a48bbc52ad4abcdaac7eca9d1 Mon Sep 17 00:00:00 2001 From: cody <648753004@qq.com> Date: Sun, 24 Aug 2025 10:21:25 +0800 Subject: [PATCH] update --- app/Http/Controllers/Admin/SupplyDemandController.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/Admin/SupplyDemandController.php b/app/Http/Controllers/Admin/SupplyDemandController.php index 3e40c56..273d806 100755 --- a/app/Http/Controllers/Admin/SupplyDemandController.php +++ b/app/Http/Controllers/Admin/SupplyDemandController.php @@ -278,7 +278,13 @@ class SupplyDemandController extends BaseController } })->whereBetween('created_at', [$startDate, $endDate]) ->paginate($all['page_size'] ?? 20); - + foreach ($list as $item) { + $item->dialogue = Dialogue::with('user', 'toUser')->where(function ($query) use ($item) { + $query->where('user_id', $item->user_id)->where('to_user_id', $item->to_user_id); + })->orWhere(function ($query) use ($item) { + $query->where('user_id', $item->to_user_id)->where('to_user_id', $item->user_id); + })->first(); + } return $this->success([ 'list' => $list, 'supply_demand_count' => $supplyDemandCount,