AgentListController.php 1.4 KB

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