Authored by yangyang

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

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