InfoController.php 3.6 KB

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