|
|
@@ -5,6 +5,7 @@ use common\components\Model;
|
|
|
use common\helpers\Cache;
|
|
|
use common\helpers\Date;
|
|
|
use common\helpers\Form;
|
|
|
+use common\helpers\LoggerTool;
|
|
|
use common\helpers\user\Cash;
|
|
|
use common\helpers\user\Info;
|
|
|
use common\models\Config;
|
|
|
@@ -223,14 +224,14 @@ class DeclarationUpgradeForm extends Model
|
|
|
}else if($checkPv < $decLevel['PERF']) {
|
|
|
throw new Exception(Yii::t('app', 'totalPVLessThan'), 400);
|
|
|
}
|
|
|
- foreach ($decLevelConfig as $key=>$val){
|
|
|
- if($checkPv>=$val['PERF']){
|
|
|
- $toDecLevel = $key;
|
|
|
- }
|
|
|
- }
|
|
|
- if($this->decLv!=$toDecLevel){
|
|
|
+
|
|
|
+ // 会员已有PV+本次订单PV 不能多于 下一个级别所需PV
|
|
|
+ $nextDecLv = DeclarationLevel::getNextDecLv($toDecLevel);
|
|
|
+ LoggerTool::debug(['Ats', $nextDecLv, $checkPv]);
|
|
|
+ if ($nextDecLv && ($checkPv >= $nextDecLv['PERF'])) {
|
|
|
throw new Exception(Yii::t('app', 'totalPvExceedPv'), 400);
|
|
|
}
|
|
|
+
|
|
|
$this->_decAmount = $totalAmount;
|
|
|
$this->_decPv = $totalPv;
|
|
|
$this->_decAmountStandard = $totalAmountStandard;
|