AgentList.php 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. /**
  3. * AgentList.php UTF-8
  4. * 渠道列表
  5. *
  6. * @date : 2018/5/19 17:52
  7. *
  8. * @license 这不是一个自由软件,未经授权不许任何使用和传播。
  9. * @author : wuyonghong <wyh@huosdk.com>
  10. * @version : HUOSDK 8.0
  11. */
  12. namespace huo\controller\agent;
  13. use huo\controller\common\Base;
  14. use huo\logic\agent\AgentListLogic;
  15. use huo\logic\agent\AgentLogic;
  16. use huolib\status\MemberStatus;
  17. class AgentList extends Base {
  18. /**
  19. * 获取渠道列表
  20. *
  21. * @param $agent_id
  22. * @param array $param
  23. * @param string $page
  24. *
  25. * @return array
  26. */
  27. public function getAgentList($agent_id, $param = [], $page = '1,10') {
  28. $_map = $param;
  29. $_agent_ids = (new AgentLogic())->getAgentIds($agent_id, true);
  30. $_map['parent_id'] = $agent_id;
  31. $_map['agent_id'] = ['in', $_agent_ids];
  32. $_data = (new AgentListLogic())->getAgentList($_map, $page);
  33. $_code = MemberStatus::NO_ERROR;
  34. return $this->huoSuccess($_code, MemberStatus::getMsg($_code), $_data);
  35. }
  36. }