UserLabelController.php 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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. logic\user\UserLabelLogic,
  22. controller\BaseAdminController,
  23. validate\user\UserLableValidate,
  24. };
  25. class UserLabelController extends BaseAdminController
  26. {
  27. /**
  28. * @notes 等级标签列表
  29. * @return \think\response\Json
  30. * @author cjhao
  31. * @date 2021/7/28 16:44
  32. */
  33. public function lists()
  34. {
  35. return $this->dataLists();
  36. }
  37. /**
  38. * @notes 新增用户标签
  39. * @return \think\response\Json
  40. * @author cjhao
  41. * @date 2021/7/28 17:48
  42. */
  43. public function add()
  44. {
  45. $params = (new UserLableValidate())->post()->goCheck('add');
  46. (new UserLabelLogic)->add($params);
  47. return $this->success('添加标签成功', [], 1, 1);
  48. }
  49. /**
  50. * @notes 获取用户标签
  51. * @return \think\response\Json
  52. * @author cjhao
  53. * @date 2021/7/28 18:05
  54. */
  55. public function detail()
  56. {
  57. $id = $this->request->get('id');
  58. $detail = (new UserLabelLogic())->detail($id);
  59. return $this->success('',$detail);
  60. }
  61. /**
  62. * @notes 编辑用户标签
  63. * @return \think\response\Json
  64. * @author cjhao
  65. * @date 2021/7/28 18:06
  66. */
  67. public function edit()
  68. {
  69. $params = (new UserLableValidate())->post()->goCheck('edit');
  70. (new UserLabelLogic())->edit($params);
  71. return $this->success('修改标签成功', [], 1, 1);
  72. }
  73. /**
  74. * @notes 删除标签
  75. * @return \think\response\Json
  76. * @author cjhao
  77. * @date 2021/7/28 18:38
  78. */
  79. public function del(){
  80. $params = (new UserLableValidate())->post()->goCheck('del');
  81. (new UserLabelLogic())->del($params['ids']);
  82. return $this->success('删除成功');
  83. }
  84. }