AgentListController.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. namespace app\v1\controller\advert;
  3. use plugin\saiadmin\basic\BaseController;
  4. use app\v1\logic\advert\AgentListLogic;
  5. use app\v1\validate\advert\AgentListValidate;
  6. use plugin\saiadmin\app\logic\system\SystemUserLogic;
  7. use support\Request;
  8. use support\Response;
  9. /**
  10. * 渠道管理控制器
  11. */
  12. class AgentListController extends BaseController
  13. {
  14. protected $systemUserLogic;
  15. /**
  16. * 构造函数
  17. */
  18. public function __construct()
  19. {
  20. $this->logic = new AgentListLogic();
  21. $this->validate = new AgentListValidate;
  22. parent::__construct();
  23. $this->systemUserLogic = new SystemUserLogic();
  24. }
  25. /**
  26. * 数据列表
  27. * @param Request $request
  28. * @return Response
  29. */
  30. public function index(Request $request): Response
  31. {
  32. $where = $request->more([
  33. ['auth_id', ''],
  34. ['name', ''],
  35. ['id', ''],
  36. ['media_id', ''],
  37. ]);
  38. $query = $this->logic->search($where);
  39. $data = $this->logic->getList($query);
  40. $data=$this->logic->trandformListColumn($data['data'],['auth','media']);
  41. return $this->success($data);
  42. }
  43. }