// +---------------------------------------------------------------------- namespace app\portal\model; use app\admin\model\RouteModel; use think\Model; use tree\Tree; use think\db\Query; use think\facade\Db; class UserinfoModel extends Model { /** * 模型名称 * @var string */ protected $name = 't_userinfo'; protected $connection = 'watercat'; protected $type = [ 'more' => 'array', ]; public function getlist() { // $where = ['isactive' => 1, 'sfzid' => ['NOT NULL', ''], 'wname' => ['NOTNULL', ''], 'photourl' => ['NOTNULL', '']]; // $where = ['isactive' => 1, 'sfzid' => ['LIKE', '%1%']]; $field = ['id', 'wname', 'photourl']; $order = "last_unonline_time deac"; $list = $this->field($field) ->where('isactive', 1) ->where('sfzid', 'not null') ->where('wname', 'not null') ->where('photourl', 'not null') ->where('photourl', '<>', "") ->order($order)->page(1, 6)->select(); return $list; } /** * 获取工种 * * @return void * @author wj * @date 2025-09-10 */ public function getworktype($userid) { $sql = "select workertypedisstr,sum(skillscore) skillscore from t_workertech where uid='" . $userid . "' and workertype is not null group by workertypedisstr order by sum(skillscore) desc"; $list = Db::connect($this->connection)->query($sql); return $list; } }