OrderController.php 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | likeshop100%开源免费商用商城系统
  4. // +----------------------------------------------------------------------
  5. // | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
  6. // | 开源版本可自由商用,可去除界面版权logo
  7. // | 商业版本务必购买商业授权,以免引起法律纠纷
  8. // | 禁止对系统程序代码以任何目的,任何形式的再发布
  9. // | gitee下载:https://gitee.com/likeshop_gitee
  10. // | github下载:https://github.com/likeshop-github
  11. // | 访问官网:https://www.likeshop.cn
  12. // | 访问社区:https://home.likeshop.cn
  13. // | 访问手册:http://doc.likeshop.cn
  14. // | 微信公众号:likeshop技术社区
  15. // | likeshop团队 版权所有 拥有最终解释权
  16. // +----------------------------------------------------------------------
  17. // | author: likeshopTeam
  18. // +----------------------------------------------------------------------
  19. namespace app\businessapi\controller;
  20. use app\businessapi\lists\VerificationOrderLists;
  21. use app\businessapi\logic\OrderLogic;
  22. use app\businessapi\validate\OrderValidate;
  23. /**
  24. * 订单控制器类
  25. * Class OrderController
  26. * @package app\businessapi\controller
  27. */
  28. class OrderController extends BaseBusinesseController
  29. {
  30. /**
  31. * @notes 查看订单列表
  32. * @return \think\response\Json
  33. * @author ljj
  34. * @date 2021/8/4 3:05 下午
  35. */
  36. public function lists()
  37. {
  38. return $this->dataLists();
  39. }
  40. /**
  41. * @notes 订单详情
  42. * @return \think\response\Json
  43. * @author cjhao
  44. * @date 2023/2/16 18:49
  45. */
  46. public function detail()
  47. {
  48. $params = (new OrderValidate())->goCheck('id');
  49. return $this->data((new OrderLogic())->detail($params));
  50. }
  51. /**
  52. * @notes 取消订单
  53. * @return \think\response\Json
  54. * @author ljj
  55. * @date 2021/8/10 4:51 下午
  56. */
  57. public function cancel()
  58. {
  59. $params = (new OrderValidate())->post()->goCheck('cancel', ['admin_id' => $this->adminId]);
  60. $result = (new OrderLogic())->cancel($params);
  61. if (false === $result) {
  62. return $this->fail(OrderLogic::getError());
  63. }
  64. return $this->success('取消成功',[],1,1);
  65. }
  66. /**
  67. * @notes 确认线下支付
  68. * @return \think\response\Json
  69. * @author lbzy
  70. * @datetime 2024-03-06 14:26:38
  71. */
  72. function confirmOfflinePay()
  73. {
  74. $result = (new OrderLogic())->confirmOfflinePay(input());
  75. if (false === $result) {
  76. return $this->fail(OrderLogic::getError());
  77. }
  78. return $this->success('确认付款成功',[],1,1);
  79. }
  80. /**
  81. * @notes 获取地址
  82. * @return \think\response\Json
  83. * @author cjhao
  84. * @date 2023/2/17 17:34
  85. */
  86. public function getAddress()
  87. {
  88. $params = (new OrderValidate())->goCheck('id');
  89. return $this->data((new OrderLogic())->getAddress($params));
  90. }
  91. /**
  92. * @notes 修改地址
  93. * @return \think\response\Json
  94. * @throws \think\db\exception\DataNotFoundException
  95. * @throws \think\db\exception\DbException
  96. * @throws \think\db\exception\ModelNotFoundException
  97. * @author ljj
  98. * @date 2021/8/10 11:37 上午
  99. */
  100. public function addressEdit()
  101. {
  102. $params = (new OrderValidate())->post()->goCheck('AddressEdit', ['admin_id' => $this->adminId]);
  103. $result = (new OrderLogic())->addressEdit($params);
  104. if (true !== $result) {
  105. return $this->fail(OrderLogic::getError());
  106. }
  107. return $this->success('修改成功',[],1,1);
  108. }
  109. /**
  110. * @notes 查看物流
  111. * @return \think\response\Json
  112. * @author ljj
  113. * @date 2021/8/13 6:08 下午
  114. */
  115. public function orderTraces()
  116. {
  117. $params = (new OrderValidate())->goCheck('OrderTraces');
  118. $result = (new OrderLogic())->orderTraces($params);
  119. return $this->data($result);
  120. }
  121. /**
  122. * @notes 确认收货
  123. * @return \think\response\Json
  124. * @author cjhao
  125. * @date 2023/2/17 10:40
  126. */
  127. public function confirm()
  128. {
  129. $params = (new OrderValidate())->post()->goCheck('confirm', ['admin_id' => $this->adminId]);
  130. (new OrderLogic())->confirm($params);
  131. return $this->success('操作成功',[],1,1);
  132. }
  133. /**
  134. * @notes 核销订单列表
  135. * @return \think\response\Json
  136. * @author cjhao
  137. * @date 2023/2/17 10:52
  138. */
  139. public function verificationOrderLists()
  140. {
  141. return $this->dataLists(new VerificationOrderLists());
  142. }
  143. /**
  144. * @notes 获取核销订单
  145. * @return \think\response\Json
  146. * @author cjhao
  147. * @date 2023/2/17 11:39
  148. */
  149. public function getVerificationOrder()
  150. {
  151. $params = (new OrderValidate())->get()->goCheck('code');
  152. $order = (new OrderLogic())->getVerificationOrder($params);
  153. return $this->success('操作成功',$order,1,1);
  154. }
  155. /**
  156. * @notes 提货核销
  157. * @return \think\response\Json
  158. * @throws \think\db\exception\DataNotFoundException
  159. * @throws \think\db\exception\DbException
  160. * @throws \think\db\exception\ModelNotFoundException
  161. * @author ljj
  162. * @date 2021/8/12 11:57 上午
  163. */
  164. public function verification()
  165. {
  166. $params = (new OrderValidate())->post()->goCheck('verification', ['admin_info'=>$this->adminInfo]);
  167. $result = (new OrderLogic())->verification($params);
  168. if (true !== $result) {
  169. if (is_array($result)) {
  170. return $this->success($result['msg'],[],10,1);
  171. }
  172. return $this->fail(OrderLogic::getError());
  173. }
  174. return $this->success('操作成功',[],1,1);
  175. }
  176. /**
  177. * @notes 发货
  178. * @return \think\response\Json
  179. * @author ljj
  180. * @date 2021/8/10 6:25 下午
  181. */
  182. public function delivery()
  183. {
  184. $params = (new OrderValidate())->post()->goCheck('delivery', ['admin_id' => $this->adminId]);
  185. $result = (new OrderLogic())->delivery($params);
  186. if (false === $result) {
  187. return $this->fail(OrderLogic::getError());
  188. }
  189. return $this->success('发货成功',[],1,1);
  190. }
  191. /**
  192. * @notes 发货信息
  193. * @return \think\response\Json
  194. * @author cjhao
  195. * @date 2023/2/20 11:32
  196. */
  197. public function getDeliverInfo()
  198. {
  199. $params = (new OrderValidate())->goCheck('id');
  200. $result = (new OrderLogic())->getDeliverInfo($params);
  201. return $this->success('',$result);
  202. }
  203. }