BannerController.php 3.5 KB

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