OrderController.php 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253
  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\adminapi\controller\order;
  20. use app\adminapi\controller\BaseAdminController;
  21. use app\adminapi\lists\order\OrderLists;
  22. use app\adminapi\logic\order\OrderLogic;
  23. use app\adminapi\validate\order\OrderValidate;
  24. use app\common\service\JsonService;
  25. class OrderController extends BaseAdminController
  26. {
  27. /**
  28. * @notes 查看订单列表
  29. * @return \think\response\Json
  30. * @author ljj
  31. * @date 2021/8/4 3:05 下午
  32. */
  33. public function lists()
  34. {
  35. return $this->dataLists(new OrderLists());
  36. }
  37. /**
  38. * @notes 查看其他列表
  39. * @return \think\response\Json
  40. * @author ljj
  41. * @date 2021/8/4 8:51 下午
  42. */
  43. public function otherLists()
  44. {
  45. $result = (new OrderLogic())->otherLists();
  46. return $this->success('',$result);
  47. }
  48. /**
  49. * @notes 查看订单详情
  50. * @return \think\response\Json
  51. * @author ljj
  52. * @date 2021/8/6 4:56 下午
  53. */
  54. public function detail()
  55. {
  56. $params = (new OrderValidate())->goCheck('detail');
  57. $result = (new OrderLogic())->detail($params);
  58. return $this->success('',$result);
  59. }
  60. /**
  61. * @notes 修改地址
  62. * @return \think\response\Json
  63. * @throws \think\db\exception\DataNotFoundException
  64. * @throws \think\db\exception\DbException
  65. * @throws \think\db\exception\ModelNotFoundException
  66. * @author ljj
  67. * @date 2021/8/10 11:37 上午
  68. */
  69. public function addressEdit()
  70. {
  71. $params = (new OrderValidate())->post()->goCheck('AddressEdit', ['admin_id' => $this->adminId]);
  72. (new OrderLogic())->addressEdit($params);
  73. return $this->success('修改成功',[],1,1);
  74. }
  75. /**
  76. * @notes 设置商家备注
  77. * @return \think\response\Json
  78. * @throws \think\db\exception\DataNotFoundException
  79. * @throws \think\db\exception\DbException
  80. * @throws \think\db\exception\ModelNotFoundException
  81. * @author ljj
  82. * @date 2021/8/10 11:49 上午
  83. */
  84. public function orderRemarks()
  85. {
  86. $params = (new OrderValidate())->post()->goCheck('OrderRemarks', ['admin_id' => $this->adminId]);
  87. (new OrderLogic())->orderRemarks($params);
  88. return $this->success('修改成功',[],1,1);
  89. }
  90. /**
  91. * @notes 修改价格(订单详情)
  92. * @return \think\response\Json
  93. * @author ljj
  94. * @date 2021/8/10 2:52 下午
  95. */
  96. public function changePrice()
  97. {
  98. $params = (new OrderValidate())->post()->goCheck('ChangePrice', ['admin_id' => $this->adminId]);
  99. $result = (new OrderLogic())->changePrice($params);
  100. if (false === $result) {
  101. return $this->fail(OrderLogic::getError());
  102. }
  103. return $this->success('修改成功',[],1,1);
  104. }
  105. /**
  106. * @notes 修改运费(订单详情)
  107. * @return \think\response\Json
  108. * @throws \think\db\exception\DataNotFoundException
  109. * @throws \think\db\exception\DbException
  110. * @throws \think\db\exception\ModelNotFoundException
  111. * @author ljj
  112. * @date 2021/8/10 3:12 下午
  113. */
  114. public function changeExpressPrice()
  115. {
  116. $params = (new OrderValidate())->post()->goCheck('ChangeExpressPrice', ['admin_id' => $this->adminId]);
  117. $result = (new OrderLogic())->changeExpressPrice($params);
  118. if (false === $result) {
  119. return $this->fail(OrderLogic::getError());
  120. }
  121. return $this->success('修改成功',[],1,1);
  122. }
  123. /**
  124. * @notes 取消订单
  125. * @return \think\response\Json
  126. * @author ljj
  127. * @date 2021/8/10 4:51 下午
  128. */
  129. public function cancel()
  130. {
  131. $params = (new OrderValidate())->post()->goCheck('cancel', ['admin_id' => $this->adminId]);
  132. $result = (new OrderLogic())->cancel($params);
  133. if (false === $result) {
  134. return $this->fail(OrderLogic::getError());
  135. }
  136. return $this->success('取消成功',[],1,1);
  137. }
  138. /**
  139. * @notes 确认线下支付
  140. * @return \think\response\Json
  141. * @author lbzy
  142. * @datetime 2024-03-06 14:26:38
  143. */
  144. function confirmOfflinePay()
  145. {
  146. $result = (new OrderLogic())->confirmOfflinePay(input());
  147. if (false === $result) {
  148. return $this->fail(OrderLogic::getError());
  149. }
  150. return $this->success('确认付款成功',[],1,1);
  151. }
  152. /**
  153. * @notes 发货
  154. * @return \think\response\Json
  155. * @author ljj
  156. * @date 2021/8/10 6:25 下午
  157. */
  158. public function delivery()
  159. {
  160. $params = (new OrderValidate())->post()->goCheck('delivery', ['admin_id' => $this->adminId]);
  161. $result = (new OrderLogic())->delivery($params);
  162. if (false === $result) {
  163. return $this->fail(OrderLogic::getError());
  164. }
  165. return $this->success('发货成功',[],1,1);
  166. }
  167. /**
  168. * @notes 发货信息
  169. * @return \think\response\Json
  170. * @author ljj
  171. * @date 2021/8/10 7:16 下午
  172. */
  173. public function deliveryInfo()
  174. {
  175. $params = (new OrderValidate())->goCheck('DeliveryInfo');
  176. $result = (new OrderLogic())->deliveryInfo($params);
  177. return $this->success('',$result);
  178. }
  179. /**
  180. * @notes 确认收货
  181. * @return \think\response\Json
  182. * @author ljj
  183. * @date 2021/8/11 10:37 上午
  184. */
  185. public function confirm()
  186. {
  187. $params = (new OrderValidate())->post()->goCheck('confirm', ['admin_id' => $this->adminId]);
  188. (new OrderLogic())->confirm($params);
  189. return $this->success('操作成功',[],1,1);
  190. }
  191. /**
  192. * @notes 物流查询
  193. * @return \think\response\Json
  194. * @author ljj
  195. * @date 2021/8/13 3:49 下午
  196. */
  197. public function logistics()
  198. {
  199. $params = (new OrderValidate())->goCheck('logistics');
  200. $result = (new OrderLogic())->logistics($params);
  201. return $this->success('',$result);
  202. }
  203. /**
  204. * @notes 小票打印
  205. * @return \think\response\Json
  206. * @author Tab
  207. * @date 2021/11/16 11:16
  208. */
  209. public function orderPrint()
  210. {
  211. $params = (new OrderValidate())->post()->goCheck("orderPrint");
  212. $result = (new OrderLogic())->orderPrint($params);
  213. if ($result) {
  214. return $this->success('打印成功,如未出小票,请检查打印机是否在线和纸张是否充足',[],1,1);
  215. }
  216. return JsonService::fail(OrderLogic::getError());
  217. }
  218. /**
  219. * @notes 修改物流信息
  220. * @return \think\response\Json
  221. * @author cjhao
  222. * @date 2022/9/5 14:28
  223. */
  224. public function changeDelivery()
  225. {
  226. $params = $this->request->post();
  227. $result = (new OrderLogic())->changeDelivery($params);
  228. if(true === $result){
  229. return $this->success('修改成功',[],1,1);
  230. }
  231. return JsonService::fail($result);
  232. }
  233. }