From 9a6684ca68e5c1cb510b0e9c9947b63aee9d9a9a Mon Sep 17 00:00:00 2001 From: chenbo <709206448@qq.com> Date: Thu, 29 Feb 2024 17:58:48 +0800 Subject: [PATCH] add --- app/adminapi/controller/CostConsultationReportController.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/adminapi/controller/CostConsultationReportController.php b/app/adminapi/controller/CostConsultationReportController.php index 99212b9a9..6f4a9649b 100644 --- a/app/adminapi/controller/CostConsultationReportController.php +++ b/app/adminapi/controller/CostConsultationReportController.php @@ -112,7 +112,9 @@ class CostConsultationReportController extends BaseAdminController return $count > 0 ? 1: 0; }); $count = $query->count(); - $lists = $query->page($page_no, $page_size)->select(); + $lists = $query->append(['dept'])->withAttr('dept', function ($value, $data){ + return Dept::where('id', $data['depar'])->findOrEmpty()->toArray(); + })->page($page_no, $page_size)->select(); return $this->success('成功', compact('count', 'lists', 'page_no', 'page_size')); } } \ No newline at end of file