diff --git a/app/common/dao/marketing/AgentDao.php b/app/common/dao/marketing/AgentDao.php index 60cd5fd..200385f 100644 --- a/app/common/dao/marketing/AgentDao.php +++ b/app/common/dao/marketing/AgentDao.php @@ -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'); diff --git a/app/controller/admin/marketing/Agent.php b/app/controller/admin/marketing/Agent.php index fd2d71e..343901f 100644 --- a/app/controller/admin/marketing/Agent.php +++ b/app/controller/admin/marketing/Agent.php @@ -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);