['status'], '%like%' => ['nick_name','phone'], ]; } // 获取用户列表 public function lists(): array { $field = "id,phone,avatar,nick_name,real_name,id_card,gender,age,total_balance,total_integral,status,create_time"; return User::field($field)->where($this->searchWhere)->where('status','<>',2) ->limit($this->limitOffset, $this->limitLength) ->order('id desc')->select()->each(function($item){ $item['status_text'] = $item->status_text; $item['gender_text'] = $item->gender_text; })->toArray(); } // 获取数量 public function count(): int { return User::field('id')->where($this->searchWhere)->where('status','<>',2)->count(); } }