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,