34 lines
889 B
PHP
34 lines
889 B
PHP
<?php
|
|
|
|
|
|
namespace app\common\dao\user;
|
|
|
|
use app\common\dao\BaseDao;
|
|
use app\common\model\user\UserBrokerageApplyFormal;
|
|
|
|
class UserBrokerageApplyFormalDao extends BaseDao{
|
|
|
|
protected function getModel(): string{
|
|
return UserBrokerageApplyFormal::class;
|
|
}
|
|
|
|
// 公共搜索模型
|
|
public function searchModel(array $search){
|
|
return (new UserBrokerageApplyFormal())
|
|
->when(isset($search['id']) && $search['id'] !== '',function($query) use ($search){
|
|
$query->where('id',$search['id']);
|
|
})
|
|
->when(isset($search['uid']) && $search['uid'] !== '',function($query) use ($search){
|
|
$query->where('uid',$search['uid']);
|
|
})
|
|
->with([
|
|
'user' => function($query){
|
|
$query->field('uid,nickname,avatar');
|
|
}
|
|
]);
|
|
}
|
|
|
|
|
|
|
|
}
|