RefundController.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <?php
  2. namespace addons\StarChain\backend\controllers;
  3. use addons\StarChain\common\services\OrderService;
  4. use addons\StarChain\common\services\RefundService;
  5. /**
  6. * 售后订单
  7. */
  8. class RefundController extends BaseController
  9. {
  10. /**
  11. * 售后列表
  12. *
  13. * @return string
  14. */
  15. public function actionIndex()
  16. {
  17. if ($this->request->isAjax) {
  18. $params = $this->request->get();
  19. $service = new RefundService(['mall_id' => $this->mall_id]);
  20. return $this->success('ok', $service->getRefundList($params));
  21. }
  22. return $this->render($this->action->id);
  23. }
  24. /**
  25. * 同意申请
  26. *
  27. * @return string
  28. */
  29. public function actionAgree()
  30. {
  31. if ($this->request->isAjax) {
  32. $id = $this->request->getBodyParam('id');
  33. $service = new RefundService(['mall_id' => $this->mall_id]);
  34. return $service->agree([$id])
  35. ? $this->success('ok')
  36. : $this->error('推送失败');
  37. }
  38. }
  39. /**
  40. * 驳回申请
  41. *
  42. * @return string
  43. */
  44. public function actionReject()
  45. {
  46. if ($this->request->isAjax) {
  47. $id = $this->request->getBodyParam('id');
  48. $service = new RefundService(['mall_id' => $this->mall_id]);
  49. return $service->reject([$id])
  50. ? $this->success('ok')
  51. : $this->error('操作失败');
  52. }
  53. }
  54. }