|
@@ -173,6 +173,26 @@ class User extends Base
|
|
|
$info->hidden(['userInfo','password','salt','accountItem']);
|
|
|
return success('获取成功',$info);
|
|
|
}
|
|
|
+
|
|
|
+ public function GetUserQueryByCondition(){
|
|
|
+ $post =$this->request->param(['nickname'=>'','username'=>'','level'=>'','itemid'=>'','size'=>100,
|
|
|
+ 'status'=>''],'post','trim');
|
|
|
+ $where=[['is_del','=',0]];
|
|
|
+ if($post['nickname']!='') $where[]=['userInfo.nickname','like',"%{$post['nickname']}%"];
|
|
|
+ if($post['username']!='') $where[]=['username','like',"%{$post['username']}%"];
|
|
|
+ if($post['status']!=='')$where[]=['status','=',$post['status']];
|
|
|
+ if($post['level']!=0) $where[]=['level','=',$post['level']];
|
|
|
+ if($post['itemid']!=0) $where[]=['accountItem.itemid','=',$post['itemid']];
|
|
|
+ $info=$this->model
|
|
|
+ ->withJoin(['userInfo','account_item'],'left')
|
|
|
+ ->where($where)
|
|
|
+ ->field("length(nickname) nameL")
|
|
|
+ ->limit(intval($post['size']))
|
|
|
+ ->order('nameL asc')
|
|
|
+ ->select();
|
|
|
+ $info->hidden(['userInfo','password','salt','accountItem','account_item']);
|
|
|
+ return success('获取成功',$info);
|
|
|
+ }
|
|
|
//修改账户字段
|
|
|
public function userChange(){
|
|
|
$param =$this->request->param([
|