OrderController.php 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  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. $params['store_id'] = $this->storeId || 0;
  22. return $this->service->getDataList($params, $pageSize);
  23. }
  24. /**
  25. * 删除
  26. */
  27. public function delete()
  28. {
  29. return $this->service->delete();
  30. }
  31. /**
  32. * 修改状态
  33. */
  34. public function status()
  35. {
  36. return $this->service->status();
  37. }
  38. /**
  39. * 获取详情
  40. */
  41. public function info()
  42. {
  43. $id = request()->get('id');
  44. return $this->service->getInfo($id);
  45. }
  46. /**
  47. * 完成支付
  48. */
  49. public function completePay()
  50. {
  51. return $this->service->completePay();
  52. }
  53. /**
  54. * 发货公司列表
  55. */
  56. public function deliverList()
  57. {
  58. return $this->service->getDeliveryList();
  59. }
  60. /**
  61. * 订单发货
  62. */
  63. public function deliver()
  64. {
  65. return $this->service->deliverOrder();
  66. }
  67. /**
  68. * 订单完成
  69. */
  70. public function complete()
  71. {
  72. return $this->service->completeOrder();
  73. }
  74. /**
  75. * 取消订单
  76. */
  77. public function cancel()
  78. {
  79. return $this->service->cancelOrder();
  80. }
  81. /**
  82. * 申请退款
  83. */
  84. public function applyRefund()
  85. {
  86. return $this->service->applyRefund();
  87. }
  88. /**
  89. * 同意退款
  90. */
  91. public function agreeRefund()
  92. {
  93. return $this->service->agreeRefund();
  94. }
  95. /**
  96. * 确认退款
  97. */
  98. public function confirmRefund()
  99. {
  100. return $this->service->confirmRefund();
  101. }
  102. /**
  103. * 拒绝退款
  104. */
  105. public function rejectRefund()
  106. {
  107. return $this->service->rejectRefund();
  108. }
  109. /**
  110. * 订单统计
  111. */
  112. public function statistics()
  113. {
  114. return $this->service->getStatistics($this->storeId);
  115. }
  116. }