UserLevelController.php 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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\user;
  20. use app\adminapi\{
  21. validate\user\UserLevelValidate,
  22. logic\user\UserLevelLogic,
  23. controller\BaseAdminController,
  24. };
  25. /**
  26. * 会员等级控制器
  27. * Class UserLevelController
  28. * @package app\adminapi\controller\user
  29. */
  30. class UserLevelController extends BaseAdminController
  31. {
  32. /**
  33. * @notes 用户等级列表
  34. * @return \think\response\Json
  35. * @author cjhao
  36. * @date 2021/7/28 11:53
  37. */
  38. public function lists()
  39. {
  40. return $this->dataLists();
  41. }
  42. /**
  43. * @notes 添加会员等级
  44. * @return \think\response\Json
  45. * @author cjhao
  46. * @date 2021/7/28 15:09
  47. */
  48. public function add()
  49. {
  50. $params = (new UserLevelValidate())->post()->goCheck('add');
  51. (new UserLevelLogic)->add($params);
  52. return $this->success('添加等级成功',[],1,1);
  53. }
  54. /**
  55. * @notes 获取会员等级
  56. * @return \think\response\Json
  57. * @author cjhao
  58. * @date 2021/7/28 15:45
  59. */
  60. public function detail()
  61. {
  62. $id = $this->request->get('id');
  63. $detail = (new UserLevelLogic())->detail($id);
  64. return $this->success('',$detail);
  65. }
  66. /**
  67. * @notes 修改会员等级
  68. * @return \think\response\Json
  69. * @author cjhao
  70. * @date 2021/7/28 15:14
  71. */
  72. public function edit()
  73. {
  74. $params = (new UserLevelValidate())->post()->goCheck();
  75. (new UserLevelLogic)->edit($params);
  76. return $this->success('修改等级成功',[],1,1);
  77. }
  78. /**
  79. * @notes 删除会员等级
  80. * @return \think\response\Json
  81. * @author cjhao
  82. * @date 2021/7/29 10:19
  83. */
  84. public function del(){
  85. $params = (new UserLevelValidate())->post()->goCheck('del');
  86. (new UserLevelLogic())->del($params['id']);
  87. return $this->success('删除成功');
  88. }
  89. }