SelffetchShopController.php 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  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\selffetch_shop;
  20. use app\adminapi\controller\BaseAdminController;
  21. use app\adminapi\lists\selffetch_shop\SelffetchShopLists;
  22. use app\adminapi\logic\selffetch_shop\SelffetchShopLogic;
  23. use app\adminapi\validate\selffetch_shop\SelffetchShopValidate;
  24. class SelffetchShopController extends BaseAdminController
  25. {
  26. /**
  27. * @notes 添加自提门店
  28. * @return \think\response\Json
  29. * @author ljj
  30. * @date 2021/8/11 3:14 下午
  31. */
  32. public function add()
  33. {
  34. $params = (new SelffetchShopValidate())->post()->goCheck('add');
  35. (new SelffetchShopLogic())->add($params);
  36. return $this->success('添加成功',[],1,1);
  37. }
  38. /**
  39. * @notes 编辑自提门店
  40. * @return \think\response\Json
  41. * @throws \think\db\exception\DataNotFoundException
  42. * @throws \think\db\exception\DbException
  43. * @throws \think\db\exception\ModelNotFoundException
  44. * @author ljj
  45. * @date 2021/8/11 3:29 下午
  46. */
  47. public function edit()
  48. {
  49. $params = (new SelffetchShopValidate())->post()->goCheck('edit');
  50. (new SelffetchShopLogic())->edit($params);
  51. return $this->success('修改成功',[],1,1);
  52. }
  53. /**
  54. * @notes 查看自提门店详情
  55. * @return \think\response\Json
  56. * @author ljj
  57. * @date 2021/8/11 3:46 下午
  58. */
  59. public function detail()
  60. {
  61. $params = (new SelffetchShopValidate())->goCheck('detail');
  62. $result = (new SelffetchShopLogic())->detail($params);
  63. return $this->success('',$result);
  64. }
  65. /**
  66. * @notes 查看自提门店列表
  67. * @return \think\response\Json
  68. * @author ljj
  69. * @date 2021/8/11 3:58 下午
  70. */
  71. public function lists()
  72. {
  73. return $this->dataLists(new SelffetchShopLists());
  74. }
  75. /**
  76. * @notes 修改自提门店状态
  77. * @return \think\response\Json
  78. * @author ljj
  79. * @date 2021/8/11 4:17 下午
  80. */
  81. public function status()
  82. {
  83. $params = (new SelffetchShopValidate())->post()->goCheck('status');
  84. (new SelffetchShopLogic())->status($params);
  85. return $this->success('修改成功',[],1,1);
  86. }
  87. /**
  88. * @notes 删除自提门店
  89. * @return \think\response\Json
  90. * @author ljj
  91. * @date 2021/8/11 5:13 下午
  92. */
  93. public function del()
  94. {
  95. // TODO 当核销员表用到门店时,不可删除
  96. $params = (new SelffetchShopValidate())->post()->goCheck('del');
  97. (new SelffetchShopLogic())->del($params);
  98. return $this->success('删除成功',[],1,1);
  99. }
  100. /**
  101. * @notes 腾讯地图区域搜索
  102. * @return \think\response\Json
  103. * @author ljj
  104. * @date 2021/9/28 6:43 下午
  105. */
  106. public function regionSearch()
  107. {
  108. $params = (new SelffetchShopValidate())->goCheck('regionSearch');
  109. $result = (new SelffetchShopLogic())->regionSearch($params);
  110. if ($result['status'] !== 0) {
  111. return $this->fail($result['message']);
  112. }
  113. return $this->success('',$result);
  114. }
  115. }