DistributionLevelController.php 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  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\distribution;
  20. use app\adminapi\controller\BaseAdminController;
  21. use app\adminapi\logic\distribution\DistributionLevelLogic;
  22. use app\adminapi\validate\distribution\DistributionLevelValidate;
  23. /**
  24. * 分销会员等级控制器
  25. * Class DistributionLevelController
  26. * @package app\adminapi\controller\distribution
  27. */
  28. class DistributionLevelController extends BaseAdminController
  29. {
  30. /**
  31. * @notes 查看分销会员等级列表
  32. * @return \think\response\Json
  33. * @author Tab
  34. * @date 2021/7/23 9:24
  35. */
  36. public function lists()
  37. {
  38. return $this->dataLists();
  39. }
  40. /**
  41. * @notes 添加分销会员等级
  42. * @return \think\response\Json
  43. * @author Tab
  44. * @date 2021/7/22 11:19
  45. */
  46. public function add()
  47. {
  48. $params = (new DistributionLevelValidate())->post()->goCheck('add');
  49. $result = DistributionLevelLogic::add($params);
  50. if($result) {
  51. return $this->success('添加成功', [], 1, 1);
  52. }
  53. return $this->fail(DistributionLevelLogic::getError());
  54. }
  55. /**
  56. * @notes 查看分销会员等级详情
  57. * @return \think\response\Json
  58. * @author Tab
  59. * @date 2021/7/22 14:51
  60. */
  61. public function detail()
  62. {
  63. $params = (new DistributionLevelValidate())->goCheck('detail');
  64. $result = DistributionLevelLogic::detail($params);
  65. return $this->data($result);
  66. }
  67. /**
  68. * @notes 编辑分销会员等级
  69. * @return \think\response\Json
  70. * @author Tab
  71. * @date 2021/7/22 16:22
  72. */
  73. public function edit()
  74. {
  75. $params = (new DistributionLevelValidate())->post()->goCheck('edit');
  76. $result = DistributionLevelLogic::edit($params);
  77. if($result) {
  78. return $this->success('编辑成功', [], 1, 1);
  79. }
  80. return $this->fail(DistributionLevelLogic::getError());
  81. }
  82. /**
  83. * @notes 删除分销会员等级
  84. * @return \think\response\Json
  85. * @author Tab
  86. * @date 2021/7/22 16:29
  87. */
  88. public function delete()
  89. {
  90. $params = (new DistributionLevelValidate())->post()->goCheck('delete');
  91. $result = DistributionLevelLogic::delete($params);
  92. if($result) {
  93. return $this->success('删除成功', [], 1, 1);
  94. }
  95. return $this->fail(DistributionLevelLogic::getError());
  96. }
  97. /**
  98. * @notes 更新分销会员等级
  99. * @param $userId
  100. * @author Tab
  101. * @date 2021/7/27 14:02
  102. */
  103. public function updateDistributionLevel($userId)
  104. {
  105. DistributionLevelLogic::updateDistributionLevel($userId);
  106. }
  107. }