Commit cae3f32f by 冷斌

update

parent 18969c88
...@@ -522,7 +522,7 @@ ...@@ -522,7 +522,7 @@
$level=getLevelList(); $level=getLevelList();
foreach($level as $k=>$v){ foreach($level as $k=>$v){
if( $v['level_up']>=$experience){ if( $v['level_up']>$experience){
$levelid=$v['levelid']; $levelid=$v['levelid'];
break; break;
}else{ }else{
...@@ -556,7 +556,7 @@ ...@@ -556,7 +556,7 @@
$level=getLevelAnchorList(); $level=getLevelAnchorList();
foreach($level as $k=>$v){ foreach($level as $k=>$v){
if( $v['level_up']>=$experience){ if( $v['level_up']>$experience){
$levelid=$v['levelid']; $levelid=$v['levelid'];
break; break;
}else{ }else{
......
...@@ -25,14 +25,14 @@ class LevelController extends HomebaseController { ...@@ -25,14 +25,14 @@ class LevelController extends HomebaseController {
$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']+1-$userinfo['consumption']; $cha=$levelinfo['level_up']-$userinfo['consumption'];
if($cha>0) if($cha>0)
{ {
$levelinfo['levelid'] = $levelinfo['levelid'] > 1 ? ($levelinfo['levelid']-1) : $levelinfo['levelid'];
$baifen=floor($userinfo['consumption']/$levelinfo['level_up']*100); $baifen=floor($userinfo['consumption']/$levelinfo['level_up']*100);
$type="1"; $type="1";
}else{ }else{
...@@ -47,14 +47,25 @@ class LevelController extends HomebaseController { ...@@ -47,14 +47,25 @@ class LevelController extends HomebaseController {
$this->assign("type",$type); $this->assign("type",$type);
$this->assign('set', $set); $this->assign('set', $set);
$anchor_certification = 0;
$auth=M("users_auth")->where("uid={$uid}")->find();
if (!empty($auth)) {
if ($auth['status']==1) {
$anchor_certification = 1;
}
}
$this->assign('anchor_certification', $anchor_certification);
/* 主播等价 */ /* 主播等价 */
$Level_a=M("experlevel_anchor"); $Level_a=M("experlevel_anchor");
$levelinfo_a=$Level_a->where("level_up>='{$userinfo['votestotal']}'")->order("levelid asc")->find(); $levelinfo_a=$Level_a->where("level_up>='{$userinfo['votestotal']}'")->order("levelid asc")->find();
if(!$levelinfo_a){ if(!$levelinfo_a){
$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']+1-$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