From c2f3c1438aae504dffef6e453cb64799acb97637 Mon Sep 17 00:00:00 2001 From: "HDM58\\hdm58" <hdm58@qq.com> Date: Tue, 6 Jun 2023 15:46:27 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=AE=A2=E6=88=B7=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/customer/controller/Index.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/customer/controller/Index.php b/app/customer/controller/Index.php index 2ef8ab9..fad7336 100644 --- a/app/customer/controller/Index.php +++ b/app/customer/controller/Index.php @@ -104,7 +104,7 @@ class Index extends BaseController } } - $ct_sql= Db::name('CustomerTrace')->order('id desc')->limit(1)->buildSql(); + $ct_sql= Db::name('CustomerTrace')->order('id desc')->buildSql(); $orderby = 'a.create_time desc'; if(isset($param['orderby'])){ $orderby = 'ct.'.$param['orderby']; @@ -122,6 +122,7 @@ class Index extends BaseController ->join('department d', 'a.belong_did = d.id') ->join($ct_sql.' ct', 'ct.cid = a.id','left') ->order($orderby) + ->group('a.id') ->paginate($rows, false, ['query' => $param]) ->each(function ($item, $key) { $item->belong_name = Db::name('Admin')->where(['id' => $item->belong_uid])->value('name');