InfoCategoryController.php 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  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\info;
  20. use app\adminapi\controller\BaseAdminController;
  21. use app\adminapi\lists\banner\BannerLists;
  22. use app\adminapi\lists\info\InfoCategoryLists;
  23. use app\adminapi\logic\goods\GoodsBrandLogic;
  24. use app\adminapi\logic\banner\BannerLogic;
  25. use app\adminapi\validate\banner\BannerValidate;
  26. use app\adminapi\validate\info\InfoCategoryValidate;
  27. use app\adminapi\logic\info\InfoCategoryLogic;
  28. class InfoCategoryController extends BaseAdminController
  29. {
  30. /**
  31. * @notes 添加分类
  32. * @return \think\response\Json
  33. * @author ljj
  34. * @date 2021/7/14 3:04
  35. */
  36. public function add()
  37. {
  38. $params = (new InfoCategoryValidate())->post()->goCheck('add');
  39. (new InfoCategoryLogic())->add($params);
  40. return $this->success('添加分类成功',[],1,1);
  41. }
  42. /**
  43. * @notes 查看分类信息
  44. * @return \think\response\Json
  45. * @author ljj
  46. * @date 2021/7/14 5:41
  47. */
  48. public function lists()
  49. {
  50. return $this->dataLists(new InfoCategoryLists());
  51. }
  52. /**
  53. * @notes 删除分类
  54. * @return \think\response\Json
  55. * @author ljj
  56. * @date 2021/7/14 7:07
  57. */
  58. public function del()
  59. {
  60. $params = (new InfoCategoryValidate())->post()->goCheck('del');
  61. (new InfoCategoryLogic())->del($params);
  62. return $this->success('删除成功',[],1,1);
  63. }
  64. /**
  65. * @notes 编辑分类
  66. * @return \think\response\Json
  67. * @author ljj
  68. * @date 2021/7/15 10:55
  69. */
  70. public function edit()
  71. {
  72. $params = (new InfoCategoryValidate())->post()->goCheck('edit');
  73. (new InfoCategoryLogic())->edit($params);
  74. return $this->success('修改成功',[],1,1);
  75. }
  76. /**
  77. * @notes 修改分类状态
  78. * @return \think\response\Json
  79. * @throws \think\db\exception\DataNotFoundException
  80. * @throws \think\db\exception\DbException
  81. * @throws \think\db\exception\ModelNotFoundException
  82. * @author ljj
  83. * @date 2021/7/15 11:42
  84. */
  85. public function status()
  86. {
  87. $params = (new InfoCategoryValidate())->post()->goCheck('status');
  88. (new InfoCategoryLogic())->status($params);
  89. return $this->success('状态修改成功',[],1,1);
  90. }
  91. /**
  92. * @notes 查看分类详情
  93. * @return \think\response\Json
  94. * @throws \think\db\exception\DataNotFoundException
  95. * @throws \think\db\exception\DbException
  96. * @throws \think\db\exception\ModelNotFoundException
  97. * @author ljj
  98. * @date 2021/7/19 4:46 下午
  99. */
  100. public function detail()
  101. {
  102. $params = (new InfoCategoryValidate())->goCheck('detail');
  103. $result = (new InfoCategoryLogic())->detail($params);
  104. return $this->success('分类详情获取成功',$result,1,0);
  105. }
  106. }