Commit 7840c5f4 by 冷斌

fix bug

parent 8864b0de
...@@ -22,14 +22,14 @@ class LevelController extends HomebaseController { ...@@ -22,14 +22,14 @@ class LevelController extends HomebaseController {
$userinfo['avatar']=get_upload_path($userinfo['avatar']); $userinfo['avatar']=get_upload_path($userinfo['avatar']);
$this->assign("userinfo",$userinfo); $this->assign("userinfo",$userinfo);
/* 用户等级 */ /* 用户等级 */
$Level=M("experlevel"); $Level=M("experlevel");
$levelinfo=$Level->where("level_up>'{$userinfo['consumption']}'")->order("levelid asc")->find(); $levelinfo=$Level->where("level_up>'{$userinfo['consumption']}'")->order("levelid asc")->find();
if(!$levelinfo){ if(!$levelinfo){
$levelinfo=$Level->order("levelid desc")->find(); $levelinfo=$Level->order("levelid desc")->find();
} }
$cha=$levelinfo['level_up']-$userinfo['consumption']; $cha=$levelinfo['level_up']-$userinfo['consumption'];
if($cha>0) if($cha>0)
{ {
$levelinfo['levelid'] = $levelinfo['levelid'] > 1 ? ($levelinfo['levelid']-1) : $levelinfo['levelid']; $levelinfo['levelid'] = $levelinfo['levelid'] > 1 ? ($levelinfo['levelid']-1) : $levelinfo['levelid'];
...@@ -65,7 +65,7 @@ class LevelController extends HomebaseController { ...@@ -65,7 +65,7 @@ class LevelController extends HomebaseController {
$Level_a['levelid'] = $Level_a['levelid'] > 1 ? ($Level_a['levelid']-1) : $Level_a['levelid']; $Level_a['levelid'] = $Level_a['levelid'] > 1 ? ($Level_a['levelid']-1) : $Level_a['levelid'];
$levelinfo_a=$Level_a->order("levelid desc")->find(); $levelinfo_a=$Level_a->order("levelid desc")->find();
} }
$cha_a=$levelinfo_a['level_up']-$userinfo['votestotal']; $cha_a=$levelinfo_a['level_up']-$userinfo['votestotal'];
if($cha_a>0) if($cha_a>0)
{ {
$baifen_a=floor($userinfo['votestotal']/$levelinfo_a['level_up']*100); $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