OrderController.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <?php
  2. namespace addons\YunfastPay\backend\controllers;
  3. use addons\YunfastPay\common\services\OrderService;
  4. /**
  5. * 支付订单控制器
  6. * @package addons\YunfastPay\backend\controllers
  7. */
  8. class OrderController extends BaseController
  9. {
  10. public $enableCsrfValidation = false;
  11. /**
  12. * @var OrderService
  13. */
  14. private $service;
  15. public function init()
  16. {
  17. parent::init();
  18. $this->service = new OrderService(
  19. ['mall_id' => $this->mall_id]
  20. );
  21. }
  22. /**
  23. * 设置页面
  24. *
  25. * @return void
  26. */
  27. public function actionIndex()
  28. {
  29. if ($this->request->isAjax) {
  30. return $this->success(
  31. 'ok',
  32. $this->service->getPageList(
  33. array_merge(
  34. $this->request->post(),
  35. $this->request->get()
  36. )
  37. )
  38. );
  39. }
  40. return $this->render('index');
  41. }
  42. /**
  43. * 分账信息
  44. *
  45. * @return void
  46. */
  47. public function actionSplitBill()
  48. {
  49. if ($this->request->isAjax) {
  50. return $this->success(
  51. 'ok',
  52. $this->service->getSplitBill(
  53. $this->request->get('id')
  54. )
  55. );
  56. }
  57. }
  58. }