123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- <?php
- // +----------------------------------------------------------------------
- // | ThinkCMF [ WE CAN DO IT MORE SIMPLE ]
- // +----------------------------------------------------------------------
- // | Copyright (c) 2013-2019 http://www.thinkcmf.com All rights reserved.
- // +----------------------------------------------------------------------
- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
- // +----------------------------------------------------------------------
- // | Author: 老猫 <thinkcmf@126.com>
- // +----------------------------------------------------------------------
- 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;
- }
- }
|