Authored by yangyang

修复会员等级不能正确显示vip3升级进度的bug

@@ -445,7 +445,6 @@ class HomeController extends AbstractAction @@ -445,7 +445,6 @@ class HomeController extends AbstractAction
445 //显示网站导航头部信息 445 //显示网站导航头部信息
446 $this->setNavHeader('会员等级'); 446 $this->setNavHeader('会员等级');
447 $uid = $this->getUid(); 447 $uid = $this->getUid();
448 - $uid = '3566171'; //临时测试用  
449 $data = GradeModel::getGrade($uid); 448 $data = GradeModel::getGrade($uid);
450 $data['pageFooter'] = true; 449 $data['pageFooter'] = true;
451 450
@@ -49,7 +49,12 @@ class GradeModel @@ -49,7 +49,12 @@ class GradeModel
49 //今年总消费 49 //今年总消费
50 $result['vipGrade']['costOfThisYear'] = $data['costInfo']['yearTotal']; 50 $result['vipGrade']['costOfThisYear'] = $data['costInfo']['yearTotal'];
51 //升级下一等级会员的进度; 51 //升级下一等级会员的进度;
  52 + if($data['nextVipInfo']['needCost'] == 0){
  53 + //当vip等级升至顶级时,进度条满格
  54 + $result['vipGrade']['percent'] = 100;
  55 + }else{
52 $result['vipGrade']['percent'] = 100 * (round($data['costInfo']['total'] / $data['nextVipInfo']['needCost'], 2)); 56 $result['vipGrade']['percent'] = 100 * (round($data['costInfo']['total'] / $data['nextVipInfo']['needCost'], 2));
  57 + }
53 //距离升级所需消费金额 58 //距离升级所需消费金额
54 59
55 if ($data['curVipInfo']['curLevel'] != 3) { 60 if ($data['curVipInfo']['curLevel'] != 3) {