UserLevelController.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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. */
  19. public function detection(Request $request)
  20. {
  21. return app('json')->successful(UserLevel::setLevelComplete($request->uid()));
  22. }
  23. /**
  24. * 会员等级列表
  25. * @param Request $request
  26. * @return mixed
  27. */
  28. public function grade(Request $request)
  29. {
  30. return app('json')->successful(SystemUserLevel::getLevelList($request->uid()));
  31. }
  32. /**
  33. * 获取等级任务
  34. * @param Request $request
  35. * @param $id
  36. * @return mixed
  37. */
  38. public function task(Request $request, $id)
  39. {
  40. return app('json')->successful(SystemUserTask::getTashList($id,$request->uid()));
  41. }
  42. /**
  43. * 获取付费等级列表
  44. * @param Request $request
  45. * @return mixed
  46. */
  47. public function pay_grade(Request $request)
  48. {
  49. return app('json')->successful(SystemUserLevel::where('id',2)->select()->toarray());
  50. }
  51. }