OrderController.php 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  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?$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 deliver()
  57. {
  58. return $this->service->deliverOrder();
  59. }
  60. /**
  61. * 订单发货
  62. */
  63. public function getDelivery()
  64. {
  65. $id = request()->post('id',0);
  66. return $this->service->getDelivery($id);
  67. }
  68. /**
  69. * 订单结算
  70. */
  71. public function settle()
  72. {
  73. return $this->service->settleOrder();
  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. /**
  125. * 导出订单
  126. */
  127. public function export()
  128. {
  129. $params = request()->all();
  130. $params['store_id'] = $this->storeId ?: 0;
  131. return $this->service->exportData($params);
  132. }
  133. }