DecorateThemePageController.php 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  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\theme;
  20. use app\adminapi\{
  21. controller\BaseAdminController,
  22. logic\theme\DecorateThemePageLogic,
  23. validate\theme\DecoratePageValidate,
  24. };
  25. /**
  26. * 主题页面控制器
  27. * Class ThemePageController
  28. * @package app\adminapi\controller\decorate
  29. */
  30. class DecorateThemePageController extends BaseAdminController
  31. {
  32. /**
  33. * @notes 首页接口
  34. * @return \think\response\Json
  35. * @throws \think\db\exception\DataNotFoundException
  36. * @throws \think\db\exception\DbException
  37. * @throws \think\db\exception\ModelNotFoundException
  38. * @author cjhao
  39. * @date 2021/8/14 15:05
  40. */
  41. public function index(){
  42. $detail = (new DecorateThemePageLogic())->index();
  43. return $this->success('', $detail);
  44. }
  45. /**
  46. * @notes 主题页面列表
  47. * @return \think\response\Json
  48. * @author cjhao
  49. * @date 2021/8/5 10:44
  50. */
  51. public function lists()
  52. {
  53. return $this->dataLists();
  54. }
  55. /**
  56. * @notes 获取主题页面
  57. * @author cjhao
  58. * @date 2021/8/5 10:44
  59. */
  60. public function getPage()
  61. {
  62. $params = $this->request->get();
  63. $detail = (new DecorateThemePageLogic())->getPage($params);
  64. return $this->success('', $detail);
  65. }
  66. /**
  67. * @notes 设置主页
  68. * @return \think\response\Json
  69. * @author cjhao
  70. * @date 2021/8/6 16:08
  71. */
  72. public function setHome()
  73. {
  74. $params = (new DecoratePageValidate())->post()->goCheck('setHome');
  75. (new DecorateThemePageLogic())->setHome($params['id']);
  76. return $this->success('操作成功', [], 1, 1);
  77. }
  78. /**
  79. * @notes 新增主题页面
  80. * @return \think\response\Json
  81. * @author cjhao
  82. * @date 2021/8/5 11:03
  83. */
  84. public function add()
  85. {
  86. $params = $this->request->post();
  87. $id = (new DecorateThemePageLogic())->add($params);
  88. return $this->success('操作成功', ['id' => $id]);
  89. }
  90. /**
  91. * @notes 编辑主题页面
  92. * @return \think\response\Json
  93. * @author cjhao
  94. * @date 2021/8/5 11:04
  95. */
  96. public function edit()
  97. {
  98. $params = (new DecoratePageValidate())->post()->goCheck('edit');
  99. $data = (new DecorateThemePageLogic())->edit($params);
  100. return $this->success('操作成功', $data, 1, 1);
  101. }
  102. /**
  103. * @notes 删除主页
  104. * @return \think\response\Json
  105. * @author cjhao
  106. * @date 2021/8/9 19:31
  107. */
  108. public function del()
  109. {
  110. $params = (new DecoratePageValidate())->post()->goCheck('del');
  111. (new DecorateThemePageLogic())->del($params['id']);
  112. return $this->success('操作成功', [], 1, 1);
  113. }
  114. /**
  115. * @notes 商城页面
  116. * @return \think\response\Json
  117. * @author cjhao
  118. * @date 2021/8/12 16:28
  119. */
  120. public function getShopPage()
  121. {
  122. $type = $this->request->get('type','shop');
  123. $page = (new DecorateThemePageLogic())->getShopPage($type);
  124. return $this->success('操作成功',$page);
  125. }
  126. }