AgentListLogic.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | saiadmin [ saiadmin快速开发框架 ]
  4. // +----------------------------------------------------------------------
  5. // | Author: your name
  6. // +----------------------------------------------------------------------
  7. namespace app\v1\logic\advert;
  8. use plugin\saiadmin\basic\BaseLogic;
  9. use plugin\saiadmin\exception\ApiException;
  10. use plugin\saiadmin\utils\Helper;
  11. use app\v1\model\advert\AgentList;
  12. /**
  13. * 渠道管理逻辑层
  14. */
  15. class AgentListLogic extends BaseLogic
  16. {
  17. /**
  18. * 构造函数
  19. */
  20. public function __construct()
  21. {
  22. $this->model = new AgentList();
  23. }
  24. /**
  25. * 查询渠道列表Options
  26. */
  27. public function getAgentOptions()
  28. {
  29. $data = $this->model->field('id as value,name as label')->select()->toArray();
  30. $data = array_map(function ($item) {
  31. return [
  32. 'label' => $item['label'].'【' . $item['value'] . '】' ,
  33. 'value' => $item['value'],
  34. ];
  35. }, $data);
  36. return $data;
  37. }
  38. }