截流自动化的商城平台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

IntegralOrder.php 5.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | likeshop开源商城系统
  4. // +----------------------------------------------------------------------
  5. // | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
  6. // | gitee下载:https://gitee.com/likeshop_gitee
  7. // | github下载:https://github.com/likeshop-github
  8. // | 访问官网:https://www.likeshop.cn
  9. // | 访问社区:https://home.likeshop.cn
  10. // | 访问手册:http://doc.likeshop.cn
  11. // | 微信公众号:likeshop技术社区
  12. // | likeshop系列产品在gitee、github等公开渠道开源版本可免费商用,未经许可不能去除前后端官方版权标识
  13. // | likeshop系列产品收费版本务必购买商业授权,购买去版权授权后,方可去除前后端官方版权标识
  14. // | 禁止对系统程序代码以任何目的,任何形式的再发布
  15. // | likeshop团队版权所有并拥有最终解释权
  16. // +----------------------------------------------------------------------
  17. // | author: likeshop.cn.team
  18. // +----------------------------------------------------------------------
  19. namespace app\admin\controller\integral;
  20. use app\admin\logic\integral\IntegralOrderLogic;
  21. use app\admin\validate\integral\IntegralOrderValidate;
  22. use app\common\basics\AdminBase;
  23. use app\common\enum\IntegralGoodsEnum;
  24. use app\common\enum\IntegralOrderEnum;
  25. use app\common\server\JsonServer;
  26. class IntegralOrder extends AdminBase
  27. {
  28. /**
  29. * @notes 兑换订单列表
  30. * @return \think\response\Json|\think\response\View
  31. * @throws \think\db\exception\DataNotFoundException
  32. * @throws \think\db\exception\DbException
  33. * @throws \think\db\exception\ModelNotFoundException
  34. * @author ljj
  35. * @date 2022/3/3 10:38 上午
  36. */
  37. public function lists()
  38. {
  39. if ($this->request->isAjax()) {
  40. $get = $this->request->get();
  41. return JsonServer::success('', IntegralOrderLogic::lists($get));
  42. }
  43. // 订单状态
  44. $order_status = IntegralOrderEnum::getOrderStatus(true);
  45. // 兑换类型
  46. $type = IntegralGoodsEnum::getTypeDesc(true);
  47. return view('', [
  48. 'order_status' => $order_status,
  49. 'type' => $type,
  50. ]);
  51. }
  52. /**
  53. * @notes 兑换订单详情
  54. * @return \think\response\View
  55. * @author ljj
  56. * @date 2022/3/3 11:10 上午
  57. */
  58. public function detail()
  59. {
  60. $id = $this->request->get('id');
  61. $detail = IntegralOrderLogic::detail($id);
  62. return view('', [
  63. 'detail' => $detail,
  64. ]);
  65. }
  66. /**
  67. * @notes 发货详情
  68. * @return \think\response\View
  69. * @throws \think\db\exception\DataNotFoundException
  70. * @throws \think\db\exception\DbException
  71. * @throws \think\db\exception\ModelNotFoundException
  72. * @author ljj
  73. * @date 2022/3/3 11:48 上午
  74. */
  75. public function delivery()
  76. {
  77. $id = $this->request->get('id');
  78. $detail = IntegralOrderLogic::deliveryDetail($id);
  79. $express = IntegralOrderLogic::express();
  80. return view('', [
  81. 'detail' => $detail,
  82. 'express' => $express
  83. ]);
  84. }
  85. /**
  86. * @notes 发货操作
  87. * @return \think\response\Json|void
  88. * @author ljj
  89. * @date 2022/3/3 2:53 下午
  90. */
  91. public function deliveryHandle()
  92. {
  93. if ($this->request->isAjax()) {
  94. $post = $this->request->post();
  95. (new IntegralOrderValidate())->goCheck('deliveryHandle', $post);
  96. $result = IntegralOrderLogic::deliveryHandle($post,$this->adminId);
  97. if (true !== $result) {
  98. return JsonServer::error($result);
  99. }
  100. return JsonServer::success('发货成功');
  101. }
  102. }
  103. /**
  104. * @notes 物流信息
  105. * @return \think\response\View
  106. * @author ljj
  107. * @date 2022/3/3 3:32 下午
  108. */
  109. public function express()
  110. {
  111. $id = $this->request->get('id');
  112. $detail = IntegralOrderLogic::detail($id);
  113. $detail['shipping'] = IntegralOrderLogic::shippingInfo($detail['id']);
  114. return view('', [
  115. 'detail' => $detail
  116. ]);
  117. }
  118. /**
  119. * @notes 确认收货
  120. * @return \think\response\Json|void
  121. * @author ljj
  122. * @date 2022/3/3 3:39 下午
  123. */
  124. public function confirm()
  125. {
  126. if ($this->request->isAjax()) {
  127. $post = $this->request->post();
  128. (new IntegralOrderValidate())->goCheck('confirm', $post);
  129. IntegralOrderLogic::confirm($post['id'],$this->adminId);
  130. return JsonServer::success('确认成功');
  131. }
  132. }
  133. /**
  134. * @notes 取消订单
  135. * @return \think\response\Json|void
  136. * @author 段誉
  137. * @date 2022/3/3 18:00
  138. */
  139. public function cancel()
  140. {
  141. if ($this->request->isAjax()) {
  142. $post = $this->request->post();
  143. (new IntegralOrderValidate())->goCheck('cancel', $post);
  144. IntegralOrderLogic::cancel($post['id']);
  145. return JsonServer::success('取消成功');
  146. }
  147. }
  148. }