new-admin-api/app/common/repositories/user/UserBrokerageApplyFormalRep...

51 lines
1.3 KiB
PHP

<?php
namespace app\common\repositories\user;
use app\common\dao\user\UserBrokerageApplyFormalDao;
use app\common\repositories\BaseRepository;
class UserBrokerageApplyFormalRepository extends BaseRepository{
public function __construct(UserBrokerageApplyFormalDao $dao){
$this->dao = $dao;
}
/**
* Common: 查询模型
* Author: wu-hui
* Time: 2024/03/27 17:55
* @param $where
* @return \app\common\model\user\UserBrokerageApplyFormal
*/
public function searchModel($where){
return $this->dao->searchModel($where);
}
/**
* Common: 列表获取
* Author: wu-hui
* Time: 2024/03/27 17:56
* @param $search
* @param $page
* @param $limit
* @param string $field
* @return array
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
*/
public function getList($search, $page, $limit, $field = '*'){
$query = $this->dao->searchModel($search);
$list = $query
->field($field)
->order('create_time desc,id desc')
->page($page, $limit)
->select();
$count = $query->count();
return compact('count', 'list');
}
}