AreaController.php 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  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;
  20. use app\adminapi\validate\ArticleValidate;
  21. use app\adminapi\logic\ArticleLogic;
  22. use app\adminapi\validate\AreaValidate;
  23. use app\adminapi\logic\AreaLogic;
  24. class AreaController extends BaseAdminController
  25. {
  26. /**
  27. * @notes 地区列表
  28. * @return \think\response\Json
  29. * @author Tab
  30. * @date 2021/7/14 9:33
  31. */
  32. public function lists()
  33. {
  34. return $this->dataLists();
  35. }
  36. /**
  37. * @notes 添加地区信息
  38. * @return \think\response\Json
  39. * @author Tab
  40. * @date 2021/7/13 15:49
  41. */
  42. public function add()
  43. {
  44. $params = (new AreaValidate())->post()->goCheck('add');
  45. AreaLogic::add($params);
  46. return $this->success('添加成功',[],1,1);
  47. }
  48. /**
  49. * @notes 查看地区信息
  50. * @return \think\response\Json
  51. * @author Tab
  52. * @date 2021/7/13 16:53
  53. */
  54. public function detail()
  55. {
  56. $params = (new AreaValidate())->goCheck('detail');
  57. $result = AreaLogic::detail($params);
  58. return $this->data($result);
  59. }
  60. /** 编辑地区
  61. * @notes
  62. * @return \think\response\Json
  63. * @author Tab
  64. * @date 2021/7/14 9:20
  65. */
  66. public function edit()
  67. {
  68. $params = (new AreaValidate())->post()->goCheck('edit');
  69. AreaLogic::edit($params);
  70. return $this->success('编辑成功',[],1,1);
  71. }
  72. /**
  73. * @notes 删除地区信息
  74. * @return \think\response\Json
  75. * @author Tab
  76. * @date 2021/7/14 9:24
  77. */
  78. public function delete()
  79. {
  80. $params = (new AreaValidate())->post()->goCheck('delete');
  81. AreaLogic::delete($params);
  82. return $this->success('删除成功',[],1,1);
  83. }
  84. /**
  85. * @notes 修改是否显示状态
  86. * @return \think\response\Json
  87. * @throws \think\db\exception\DataNotFoundException
  88. * @throws \think\db\exception\DbException
  89. * @throws \think\db\exception\ModelNotFoundException
  90. * @author Tab
  91. * @date 2021/7/14 11:36
  92. */
  93. public function isShow()
  94. {
  95. $params = (new AreaValidate())->post()->goCheck('show');
  96. AreaLogic::isShow($params);
  97. return $this->success('修改成功',[],1,1);
  98. }
  99. }