RefundController.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php
  2. namespace addons\HuijuBill\backend\controllers;
  3. use addons\HuijuBill\common\service\RefundService;
  4. use Yii;
  5. use common\controllers\AddonsController;
  6. /**
  7. * 退款
  8. *
  9. * Class RefundController
  10. * @package addons\HuijuBill\backend\controllers
  11. */
  12. class RefundController extends BaseController
  13. {
  14. public $enableCsrfValidation = false;
  15. /**
  16. * 首页
  17. *
  18. * @return void
  19. */
  20. public function actionList()
  21. {
  22. if ($this->request->isAjax) {
  23. $params = $this->request->getQueryParams();
  24. $data = (new RefundService(['mall_id' => $this->mall_id]))->getRefundOrderList($params);
  25. return $this->success('ok', $data);
  26. }
  27. return $this->render('list');
  28. }
  29. /**
  30. * 补单
  31. *
  32. * @return void
  33. */
  34. public function actionReissue()
  35. {
  36. if (!$this->request->isPost) {
  37. return $this->error('请求错误');
  38. }
  39. // post
  40. $ids = $this->request->post('ids');
  41. if (($service = new RefundService(['mall_id' => $this->mall_id]))->reissueRefund($ids)) {
  42. return $this->success('补单申请成功');
  43. }
  44. return $this->error($service->error);
  45. }
  46. }