首页 > 其他 > 详细

根据用户的积分、获取用户的等级,如果用户没有积分,则显示没有等级

时间:2018-06-22 20:49:51      阅读:208      评论:0      收藏:0      [点我收藏+]

--t_user 用户表 t_account 积分表 t_integral 等级表
--根据用户的积分、获取用户的等级,如果用户没有积分,则显示没有等级
select t.id,t.username,ta.userId,
(select
(case
when (ta.pointValue >integral_start && ta.pointValue< integral_end) then rank_name
else null
end
) gradea
from t_integral order by gradea desc limit 0,1
) grade
from t_user t left outer join t_account ta on t.id=ta.userId where t.id=‘用户id‘;

根据用户的积分、获取用户的等级,如果用户没有积分,则显示没有等级

原文:https://www.cnblogs.com/NiceTime/p/9215394.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!