IntegralGoodsController.php 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  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\integral;
  20. use app\adminapi\controller\BaseAdminController;
  21. use app\adminapi\lists\integral\IntegralGoodsLists;
  22. use app\adminapi\logic\integral\IntegralGoodsLogic;
  23. use app\adminapi\validate\integral\IntegralGoodsValidate;
  24. /**
  25. * 积分商品
  26. * Class IntegralGoodsController
  27. * @package app\adminapi\controller\integral
  28. */
  29. class IntegralGoodsController extends BaseAdminController
  30. {
  31. /**
  32. * @notes 获取积分商品列表
  33. * @return \think\response\Json
  34. * @author 段誉
  35. * @date 2022/3/30 11:28
  36. */
  37. public function lists()
  38. {
  39. return $this->dataLists(new IntegralGoodsLists());
  40. }
  41. /**
  42. * @notes 添加积分商品
  43. * @return \think\response\Json
  44. * @author 段誉
  45. * @date 2022/3/30 14:11
  46. */
  47. public function add()
  48. {
  49. $params = (new IntegralGoodsValidate())->post()->goCheck('add');
  50. (new IntegralGoodsLogic())->add($params);
  51. return $this->success('添加成功', [], 1, 1);
  52. }
  53. /**
  54. * @notes 编辑积分商品
  55. * @return \think\response\Json
  56. * @author 段誉
  57. * @date 2022/3/30 14:11
  58. */
  59. public function edit()
  60. {
  61. $params = (new IntegralGoodsValidate())->post()->goCheck('edit');
  62. IntegralGoodsLogic::edit($params);
  63. return $this->success('编辑成功', [], 1, 1);
  64. }
  65. /**
  66. * @notes 删除积分商品
  67. * @return \think\response\Json
  68. * @author 段誉
  69. * @date 2022/3/30 14:12
  70. */
  71. public function del()
  72. {
  73. $params = (new IntegralGoodsValidate())->post()->goCheck('del');
  74. IntegralGoodsLogic::del($params['id']);
  75. return $this->success('删除成功', [], 1, 1);
  76. }
  77. /**
  78. * @notes 积分商品详情
  79. * @return \think\response\Json
  80. * @author 段誉
  81. * @date 2022/3/30 14:15
  82. */
  83. public function detail()
  84. {
  85. $params = (new IntegralGoodsValidate())->goCheck('detail');
  86. $result = IntegralGoodsLogic::detail($params['id']);
  87. return $this->success('获取成功', $result);
  88. }
  89. /**
  90. * @notes 切换积分商品状态
  91. * @return \think\response\Json
  92. * @author 段誉
  93. * @date 2022/3/30 14:15
  94. */
  95. public function status()
  96. {
  97. $params = (new IntegralGoodsValidate())->post()->goCheck('status');
  98. IntegralGoodsLogic::setStatus($params);
  99. return $this->success('设置成功', [], 1, 1);
  100. }
  101. }