优化:代理信息查询 - 支持仅显示拥有邀请供应商权限的代理人员
This commit is contained in:
parent
cc882b1b33
commit
857e36c838
|
|
@ -38,6 +38,10 @@ class AgentDao extends BaseDao{
|
|||
->when(isset($params['agent_type']) && $params['agent_type'] !== '',function($query) use ($params){
|
||||
$query->where('agent_type', (int)$params['agent_type']);
|
||||
})
|
||||
->when(isset($params['is_invite_supplier']) && $params['is_invite_supplier'] !== '',function($query) use ($params){
|
||||
// 仅获取拥有【供应商】邀请权限的代理人员 类型:1=发起人,2=省公司,3=省合伙人(外勤),4=省合伙人(内勤),5=区县运营商
|
||||
$query->whereIn('agent_type',[1,2,3,4,5]);
|
||||
})
|
||||
->with([
|
||||
'user' => function($query){
|
||||
$query->field('uid,nickname,avatar');
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ class Agent extends BaseController{
|
|||
*/
|
||||
public function agentList(){
|
||||
[$page, $limit] = $this->getPage();
|
||||
$params = $this->request->params(['uid','agent_type','contact_name','contact_phone']);
|
||||
$params = $this->request->params(['uid','agent_type','contact_name','contact_phone','is_invite_supplier']);
|
||||
$data = app()->make(AgentRepository::class)->getList((array)$params,(int)$page,(int)$limit);
|
||||
|
||||
return app('json')->success($data);
|
||||
|
|
|
|||
Loading…
Reference in New Issue