UserLevelController.php 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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\openapi\controller;
  20. use app\adminapi\logic\toutiao\ToutiaoSettingLogic;
  21. use app\openapi\logic\user\UserLogic;
  22. use app\openapi\validate\UserValidate;
  23. use app\openapi\logic\user\UserLevelLogic;
  24. use app\openapi\validate\UserLevelValidate;
  25. /**
  26. * 用户登记接口示例
  27. * Class UserController
  28. * @package app\openapi\controller
  29. */
  30. class UserLevelController extends BaseOpenController
  31. {
  32. /*
  33. * 查询会员信息
  34. * */
  35. public function getUserLevelList(){
  36. $params = (new UserLevelValidate())->get()->goCheckStrict('getUserLevelLists');
  37. $list = (new UserLevelLogic)->getUserLevelLists($params);
  38. return $this->success('获取成功', $list);
  39. }
  40. /*
  41. * 新增会员等级信息
  42. * */
  43. public function addUserLevel(){
  44. $params = (new UserLevelValidate())->post()->goCheckStrict('addUserLevel');
  45. $result = (new UserLevelLogic)->addUserLevelInfo($params);
  46. if ($result) {
  47. return $this->success('新增会员等级成功', [],1,1);
  48. }
  49. return $this->fail(UserLevelLogic::getError());
  50. }
  51. /*
  52. * 更新会员等级信息
  53. * */
  54. public function updateUserLevel(){
  55. $params = (new UserLevelValidate())->post()->goCheckStrict('updateUserLevelInfo');
  56. $result = (new UserLevelLogic)->updateUserLevel($params);
  57. if ($result) {
  58. return $this->success('编辑会员等级成功', [],1,1);
  59. }
  60. return $this->fail(UserLevelLogic::getError());
  61. }
  62. /*
  63. * 删除会员等级
  64. * */
  65. public function delUserLevel(){
  66. $params = (new UserLevelValidate())->post()->goCheckStrict('delUserLevel');
  67. $result = (new UserLevelLogic)->del($params);
  68. if ($result) {
  69. return $this->success('删除会员等级成功', [],1,1);
  70. }
  71. return $this->fail(UserLevelLogic::getError());
  72. }
  73. }