IntegralOrderController.php 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  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\adminapi\controller\integral;
  20. use app\adminapi\controller\BaseAdminController;
  21. use app\adminapi\lists\integral\IntegralOrderLists;
  22. use app\adminapi\logic\integral\IntegralOrderLogic;
  23. use app\adminapi\validate\integral\IntegralOrderValidate;
  24. class IntegralOrderController extends BaseAdminController
  25. {
  26. /**
  27. * @notes 兑换订单列表
  28. * @return \think\response\Json
  29. * @author ljj
  30. * @date 2022/3/30 5:40 下午
  31. */
  32. public function lists()
  33. {
  34. return $this->dataLists(new IntegralOrderLists());
  35. }
  36. /**
  37. * @notes 兑换订单详情
  38. * @return \think\response\Json
  39. * @author ljj
  40. * @date 2022/3/31 11:23 上午
  41. */
  42. public function detail()
  43. {
  44. $params = (new IntegralOrderValidate())->goCheck('detail');
  45. $result = (new IntegralOrderLogic())->detail($params['id']);
  46. return $this->success('获取成功', $result);
  47. }
  48. /**
  49. * @notes 发货
  50. * @return \think\response\Json
  51. * @author ljj
  52. * @date 2022/3/31 2:29 下午
  53. */
  54. public function delivery()
  55. {
  56. $params = (new IntegralOrderValidate())->post()->goCheck('delivery', ['admin_id' => $this->adminId]);
  57. $result = (new IntegralOrderLogic())->delivery($params);
  58. if (true !== $result) {
  59. return $this->fail(IntegralOrderLogic::getError());
  60. }
  61. return $this->success('发货成功',[],1,1);
  62. }
  63. /**
  64. * @notes 发货信息
  65. * @return \think\response\Json
  66. * @throws \think\db\exception\DataNotFoundException
  67. * @throws \think\db\exception\DbException
  68. * @throws \think\db\exception\ModelNotFoundException
  69. * @author ljj
  70. * @date 2022/3/31 2:37 下午
  71. */
  72. public function deliveryInfo()
  73. {
  74. $params = (new IntegralOrderValidate())->goCheck('DeliveryInfo');
  75. $result = (new IntegralOrderLogic())->deliveryInfo($params);
  76. return $this->success('',$result);
  77. }
  78. /**
  79. * @notes 确认收货
  80. * @return \think\response\Json
  81. * @author ljj
  82. * @date 2022/3/31 4:39 下午
  83. */
  84. public function confirm()
  85. {
  86. $params = (new IntegralOrderValidate())->post()->goCheck('confirm', ['admin_id' => $this->adminId]);
  87. (new IntegralOrderLogic())->confirm($params);
  88. return $this->success('操作成功',[],1,1);
  89. }
  90. /**
  91. * @notes 物流查询
  92. * @return \think\response\Json
  93. * @author 段誉
  94. * @date 2022/4/1 14:05
  95. */
  96. public function logistics()
  97. {
  98. $params = (new IntegralOrderValidate())->goCheck('logistics');
  99. $result = (new IntegralOrderLogic())->logistics($params);
  100. return $this->success('', $result);
  101. }
  102. /**
  103. * @notes 取消订单
  104. * @return \think\response\Json
  105. * @throws \think\db\exception\DataNotFoundException
  106. * @throws \think\db\exception\DbException
  107. * @throws \think\db\exception\ModelNotFoundException
  108. * @author 段誉
  109. * @date 2022/4/1 15:41
  110. */
  111. public function cancel()
  112. {
  113. $params = (new IntegralOrderValidate())->post()->goCheck('cancel', ['admin_id' => $this->adminId]);
  114. $result = (new IntegralOrderLogic())->cancel($params['id']);
  115. if (false === $result) {
  116. return $this->fail(IntegralOrderLogic::getError());
  117. }
  118. return $this->success('取消成功', [], 1, 1);
  119. }
  120. }