UserLevelController.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. namespace app\api\controller\user;
  3. use app\models\system\SystemUserLevel;
  4. use app\models\system\SystemUserTask;
  5. use app\models\user\UserLevel;
  6. use app\Request;
  7. /**
  8. * 会员等级类
  9. * Class UserLevelController
  10. * @package app\api\controller\user
  11. */
  12. class UserLevelController
  13. {
  14. /**
  15. * 检测用户是否可以成为会员
  16. * @param Request $request
  17. * @return mixed
  18. * @throws \think\db\exception\DataNotFoundException
  19. * @throws \think\db\exception\ModelNotFoundException
  20. */
  21. public function detection(Request $request)
  22. {
  23. return app('json')->successful(UserLevel::setLevelComplete($request->uid()));
  24. }
  25. /**
  26. * 会员等级列表
  27. * @param Request $request
  28. * @return mixed
  29. */
  30. public function grade(Request $request)
  31. {
  32. return app('json')->successful(SystemUserLevel::getLevelList($request->uid()));
  33. }
  34. /**
  35. * 获取等级任务
  36. * @param Request $request
  37. * @param $id
  38. * @return mixed
  39. */
  40. public function task(Request $request, $id)
  41. {
  42. return app('json')->successful(SystemUserTask::getTashList($id,$request->uid()));
  43. }
  44. }