AgentController.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?php
  2. namespace addons\YunfastPay\backend\controllers;
  3. use addons\YunfastPay\common\services\AgentService;
  4. use common\enums\ApiStatusEnum;
  5. /**
  6. * 代付订单控制器
  7. * @package addons\YunfastPay\backend\controllers
  8. */
  9. class AgentController extends BaseController
  10. {
  11. public $enableCsrfValidation = false;
  12. /**
  13. * @var AgentService
  14. */
  15. private $service;
  16. public function init()
  17. {
  18. parent::init();
  19. $this->service = new AgentService(
  20. ['mall_id' => $this->mall_id]
  21. );
  22. }
  23. /**
  24. * 设置页面
  25. *
  26. * @return void
  27. */
  28. public function actionIndex()
  29. {
  30. if ($this->request->isAjax) {
  31. return $this->success(
  32. 'ok',
  33. $this->service->getPageList(
  34. array_merge(
  35. $this->request->post(),
  36. $this->request->get()
  37. )
  38. ),
  39. ApiStatusEnum::CODE_SUCCESS,
  40. 0
  41. );
  42. }
  43. return $this->render('index');
  44. }
  45. }