From ff5222e33316c5b8fd3deb7828e819bb702fc5ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E9=92=8A?= Date: Sat, 20 Dec 2025 18:42:00 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8E=E5=8F=B0=E7=94=A8=E6=88=B7=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E6=8E=92=E5=BA=8F=E4=BF=AE=E6=94=B9=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/adminapi/controller/User.php | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/application/adminapi/controller/User.php b/application/adminapi/controller/User.php index d1c5f150..80c9bcd8 100644 --- a/application/adminapi/controller/User.php +++ b/application/adminapi/controller/User.php @@ -35,6 +35,8 @@ class User extends adminApi $page_limit = input('page_limit', 30); $search_str = input('search', ''); $search_user_code = input('search_user_code', ''); + $order_type = input('order_type', 'id'); + $order_type_val = input('order_type_val', 'desc'); $where['a.is_robot'] =0; // $where['a.delete_time'] = 0; //如果是手机号查手机号 @@ -60,7 +62,7 @@ class User extends adminApi if($is_real == 1) { $where['b.is_real'] = 1; }else { - $where['b.is_real'] = ['<>',1]; + $where['b.is_real'] = [['<>',1],['null', null],'or']; } } //高级搜索 @@ -98,19 +100,30 @@ class User extends adminApi a.init_code, a.status '; + if($order_type_val ==1){ + $order_type_val_str = 'desc'; + }else{ + $order_type_val_str = 'asc'; + } + $order = 'a.id '.$order_type_val_str; + if($order_type=='coin'){ + $order = "c.coin ".$order_type_val_str; + }elseif($order_type=='earnings'){ + $order = "c.earnings ".$order_type_val_str; + } $user_data = db::name('user')->alias('a') ->join('(SELECT * FROM fa_user_auth WHERE id IN (SELECT MAX(id) FROM fa_user_auth GROUP BY mobile)) b', 'a.mobile = b.mobile', 'LEFT') ->join('user_wallet c', 'a.id = c.user_id','LEFT') ->where($where) ->field($field) - ->order('a.id desc'); + ->order($order); $lists = $user_data->page($page, $page_limit)->select(); $count = db::name('user')->alias('a') ->join('(SELECT * FROM fa_user_auth WHERE id IN (SELECT MAX(id) FROM fa_user_auth GROUP BY mobile)) b', 'a.mobile = b.mobile', 'LEFT') ->join('user_wallet c', 'a.id = c.user_id','LEFT') ->where($where) ->field($field) - ->order('a.id desc')->count(); + ->count(); foreach ($lists as $key => $value) { if($value['status'] == 1){ $lists[$key]['status_str'] ='正常';