OrderController.php 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. <?php
  2. namespace App\Http\Controllers\Admin;
  3. use App\Services\Common\OrderService;
  4. /**
  5. * 订单控制器
  6. */
  7. class OrderController extends Backend
  8. {
  9. public function __construct()
  10. {
  11. parent::__construct();
  12. $this->service = new OrderService();
  13. }
  14. /**
  15. * 列表
  16. */
  17. public function index()
  18. {
  19. $params = request()->all();
  20. $pageSize = isset($params['limit']) ? intval($params['limit']) : PERPAGE;
  21. $storeId = isset($params['store_id'])?$params['store_id']:0;
  22. $params['store_id'] = $this->storeId?$this->storeId : $storeId;
  23. return $this->service->getDataList($params, $pageSize);
  24. }
  25. /**
  26. * 删除
  27. */
  28. public function delete()
  29. {
  30. return $this->service->delete();
  31. }
  32. /**
  33. * 修改状态
  34. */
  35. public function status()
  36. {
  37. return $this->service->status();
  38. }
  39. /**
  40. * 获取详情
  41. */
  42. public function info()
  43. {
  44. $id = request()->get('id');
  45. return $this->service->getInfo($id);
  46. }
  47. /**
  48. * 完成支付
  49. */
  50. public function completePay()
  51. {
  52. return $this->service->completePay();
  53. }
  54. /**
  55. * 发货公司列表
  56. */
  57. public function deliverList()
  58. {
  59. return $this->service->getDeliveryList();
  60. }
  61. /**
  62. * 上传发票
  63. */
  64. public function ticket()
  65. {
  66. return $this->service->ticketOrder();
  67. }
  68. /**
  69. * 订单发货
  70. */
  71. public function delivery()
  72. {
  73. return $this->service->deliverOrder();
  74. }
  75. /**
  76. * 订单完成
  77. */
  78. public function complete()
  79. {
  80. return $this->service->completeOrder();
  81. }
  82. /**
  83. * 取消订单
  84. */
  85. public function cancel()
  86. {
  87. return $this->service->cancelOrder();
  88. }
  89. /**
  90. * 申请退款
  91. */
  92. public function applyRefund()
  93. {
  94. return $this->service->applyRefund();
  95. }
  96. /**
  97. * 同意退款
  98. */
  99. public function agreeRefund()
  100. {
  101. return $this->service->agreeRefund();
  102. }
  103. /**
  104. * 确认退款
  105. */
  106. public function confirmRefund()
  107. {
  108. return $this->service->confirmRefund();
  109. }
  110. /**
  111. * 拒绝退款
  112. */
  113. public function rejectRefund()
  114. {
  115. return $this->service->rejectRefund();
  116. }
  117. /**
  118. * 订单统计
  119. */
  120. public function statistics()
  121. {
  122. return $this->service->getStatistics($this->storeId);
  123. }
  124. }