['user_status'], '%like%' => ['user_account','user_nickname','user_phone'], ]; } // 获取用户列表 public function lists(): array { $field = "id,user_avatar,user_account,user_nickname,user_phone,user_gender,user_status,create_time"; $lists = User::field($field)->where($this->searchWhere)->where('user_status','<>',2) ->limit($this->limitOffset, $this->limitLength) ->order('id desc')->select()->each(function($item){ $item['user_status_text'] = $item->user_status_text; $item['user_gender_text'] = $item->user_gender_text; })->toArray(); return $lists; } // 获取数量 public function count(): int { return User::field('id')->where($this->searchWhere)->where('user_status','<>',2)->count(); } }