Commit 8864b0de by 冷斌

fix bug

parent a5eb4830
......@@ -22,14 +22,14 @@ class LevelController extends HomebaseController {
$userinfo['avatar']=get_upload_path($userinfo['avatar']);
$this->assign("userinfo",$userinfo);
/* 用户等级 */
$Level=M("experlevel");
$levelinfo=$Level->where("level_up>='{$userinfo['consumption']}'")->order("levelid asc")->find();
if(!$levelinfo){
$levelinfo=$Level->order("levelid desc")->find();
}
$cha=$levelinfo['level_up']+1-$userinfo['consumption'];
$this->assign("userinfo",$userinfo);
/* 用户等级 */
$Level=M("experlevel");
$levelinfo=$Level->where("level_up>'{$userinfo['consumption']}'")->order("levelid asc")->find();
if(!$levelinfo){
$levelinfo=$Level->order("levelid desc")->find();
}
$cha=$levelinfo['level_up']-$userinfo['consumption'];
if($cha>0)
{
$levelinfo['levelid'] = $levelinfo['levelid'] > 1 ? ($levelinfo['levelid']-1) : $levelinfo['levelid'];
......@@ -65,7 +65,7 @@ class LevelController extends HomebaseController {
$Level_a['levelid'] = $Level_a['levelid'] > 1 ? ($Level_a['levelid']-1) : $Level_a['levelid'];
$levelinfo_a=$Level_a->order("levelid desc")->find();
}
$cha_a=$levelinfo_a['level_up']+1-$userinfo['votestotal'];
$cha_a=$levelinfo_a['level_up']-$userinfo['votestotal'];
if($cha_a>0)
{
$baifen_a=floor($userinfo['votestotal']/$levelinfo_a['level_up']*100);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment