AfterSaleController.php 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  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\after_sale;
  20. use app\adminapi\controller\BaseAdminController;
  21. use app\adminapi\logic\after_sale\AfterSaleLogic;
  22. use app\adminapi\validate\after_sale\AfterSaleValidate;
  23. use app\common\model\Order;
  24. use app\common\model\Refund;
  25. use app\common\service\pay\AliPayService;
  26. use app\common\service\WeChatConfigService;
  27. use EasyWeChat\Factory;
  28. use think\facade\Log;
  29. /**
  30. * 售后控制器
  31. * Class AfterSaleController
  32. * @package app\adminapi\controller\after_sale
  33. */
  34. class AfterSaleController extends BaseAdminController
  35. {
  36. /**
  37. * @notes 查看售后列表
  38. * @return \think\response\Json
  39. * @author Tab
  40. * @date 2021/8/2 14:16
  41. */
  42. public function lists()
  43. {
  44. return $this->dataLists();
  45. }
  46. /**
  47. * @notes 卖家同意售后
  48. * @return \think\response\Json
  49. * @author Tab
  50. * @date 2021/8/2 19:28
  51. */
  52. public function agree()
  53. {
  54. $params = (new AfterSaleValidate())->post()->goCheck('agree');
  55. $params['admin_id'] = $this->adminId;
  56. $result = AfterSaleLogic::agree($params);
  57. if($result) {
  58. return $this->success('卖家同意售后', [], 1, 1);
  59. }
  60. return $this->fail(AfterSaleLogic::getError());
  61. }
  62. /**
  63. * @notes 卖家拒绝售后
  64. * @return \think\response\Json
  65. * @author Tab
  66. * @date 2021/8/2 19:57
  67. */
  68. public function refuse()
  69. {
  70. $params = (new AfterSaleValidate())->post()->goCheck('refuse');
  71. $params['admin_id'] = $this->adminId;
  72. $result = AfterSaleLogic::refuse($params);
  73. if($result) {
  74. return $this->success('卖家拒绝售后', [], 1, 1);
  75. }
  76. return $this->fail(AfterSaleLogic::getError());
  77. }
  78. /**
  79. * @notes 卖家拒绝收货
  80. * @return \think\response\Json
  81. * @author Tab
  82. * @date 2021/8/3 11:55
  83. */
  84. public function refuseGoods()
  85. {
  86. $params = (new AfterSaleValidate())->post()->goCheck('refuseGoods');
  87. $params['admin_id'] = $this->adminId;
  88. $result = AfterSaleLogic::refuseGoods($params);
  89. if($result) {
  90. return $this->success('卖家拒绝收货', [], 1, 1);
  91. }
  92. return $this->fail(AfterSaleLogic::getError());
  93. }
  94. /**
  95. * @notes 卖家确认收货
  96. * @return \think\response\Json
  97. * @author Tab
  98. * @date 2021/8/3 14:01
  99. */
  100. public function confirmGoods()
  101. {
  102. $params = (new AfterSaleValidate())->post()->goCheck('confirmGoods');
  103. $params['admin_id'] = $this->adminId;
  104. $result = AfterSaleLogic::confirmGoods($params);
  105. if($result) {
  106. return $this->success('卖家确认收货', [], 1, 1);
  107. }
  108. return $this->fail(AfterSaleLogic::getError());
  109. }
  110. /**
  111. * @notes 卖家同意退款
  112. * @return \think\response\Json
  113. * @author Tab
  114. * @date 2021/8/3 14:18
  115. */
  116. public function agreeRefund()
  117. {
  118. $params = (new AfterSaleValidate())->post()->goCheck('agreeRefund');
  119. $params['admin_id'] = $this->adminId;
  120. $result = AfterSaleLogic::agreeRefund($params);
  121. if($result) {
  122. return $this->success('卖家同意退款', [], 1, 1);
  123. }
  124. return $this->fail(AfterSaleLogic::getError());
  125. }
  126. /**
  127. * @notes 卖家拒绝退款
  128. * @return \think\response\Json
  129. * @author Tab
  130. * @date 2021/8/3 14:28
  131. */
  132. public function refuseRefund()
  133. {
  134. $params = (new AfterSaleValidate())->post()->goCheck('refuseRefund');
  135. $params['admin_id'] = $this->adminId;
  136. $result = AfterSaleLogic::refuseRefund($params);
  137. if($result) {
  138. return $this->success('卖家拒绝退款', [], 1, 1);
  139. }
  140. return $this->fail(AfterSaleLogic::getError());
  141. }
  142. /**
  143. * @notes 卖家确认退款
  144. * @return \think\response\Json
  145. * @author Tab
  146. * @date 2021/8/3 10:47
  147. */
  148. public function confirmRefund()
  149. {
  150. $params = (new AfterSaleValidate())->post()->goCheck('confirmRefund');
  151. $params['admin_id'] = $this->adminId;
  152. $result = AfterSaleLogic::confirmRefund($params);
  153. if($result) {
  154. return $this->success('卖家确认退款', [], 1, 1);
  155. }
  156. return $this->fail(AfterSaleLogic::getError());
  157. }
  158. /**
  159. * @notes 查看售后详情
  160. * @return \think\response\Json
  161. * @author Tab
  162. * @date 2021/8/9 18:08
  163. */
  164. public function detail()
  165. {
  166. $params = (new AfterSaleValidate())->goCheck('detail');
  167. $result = AfterSaleLogic::detail($params);
  168. return $this->data($result);
  169. }
  170. }