123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- <?php
- namespace app\admin\model\user;
- use crmeb\traits\ModelTrait;
- use crmeb\basic\BaseModel;
- use think\facade\Db;
- class Examine extends BaseModel
- {
-
- protected $pk = 'id';
-
- protected $name = 'examine';
- protected $autoWriteTimestamp = true;
- use ModelTrait;
- public static function list($where)
- {
- $model = self::field('a.*,u.phone,b.real_name,c.real_name as cw_name')
- ->alias('a')
- ->leftJoin('system_admin b', 'a.admin_id = b.id')
- ->leftJoin('system_admin c', 'a.examine_id = c.id')
- ->leftJoin('user u', 'a.uid = u.uid')
- ->order('a.id DESC');
- if ($where['name'])$model->where('name' , 'like', '%'.$where['name'],'%');
- if ($where['status'])$model->where('status' , '=', $where['status']);
- $data['count'] = $model->count();
- if ($where['page'] && $where['limit']){
- $model->page($where['page'], $where['limit']);
- }else{
- $model->page(20, 1);
- }
- $list = $model->select()->toArray();
- $data['data'] = $list;
- return $data;
- }
- }
|