From 2f697dd7f4721549ef73a3aec8ec38880c43bc70 Mon Sep 17 00:00:00 2001 From: baji Date: Sun, 9 Mar 2025 14:46:17 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/controller/Index.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/api/controller/Index.php b/app/api/controller/Index.php index 9f13287..338dbe1 100755 --- a/app/api/controller/Index.php +++ b/app/api/controller/Index.php @@ -144,11 +144,11 @@ class Index extends Base public function get_user_yaoqing() { - //select * from ( SELECT pid,count(1) n FROM xinglanmh_shequt_test.`user` where pid>0 group by pid ) t where n>1 order by n desc LIMIT 10 + //select * from ( SELECT pid,count(1) n FROM `user` where pid>0 group by pid ) t where n>1 order by n desc $list = User::where('pid', '>', 0) ->field('pid, COUNT(1) as n') // 选取 pid 和 计数字段 ->group('pid') - ->having('n', '>',30) // `having` 需要使用 `as` 取别名 + ->having('n > 30') // `having` 需要使用 `as` 取别名 ->order('n desc') // ->limit(10) // 添加限制条数 ->select();