Parcourir la source

3398:暂时取消报单使用水机分期不能成为Elite限制

kevin_zhangl il y a 2 ans
Parent
commit
5ba0bfe631

+ 36 - 13
common/models/forms/ApproachDeclarationForm.php

@@ -685,23 +685,46 @@ class ApproachDeclarationForm extends Model
                             }
                             }
                         }
                         }
                     }
                     }
-                    if($totalPv<$decLevel['PERF']){
-//                        if ($hasInstalment && $decLevel['LEVEL_NAME'] == 'Elite'){
-//                        }else{
-                            throw new Exception(Yii::t('app', 'totalBVCanNotLessThanSelectedBV'));
-//                        }
+
+
+                    // todo: 3398代码块--off
+                    if (!($zcResult = $this->addUser($allData))) {
+                        throw new Exception(Form::formatErrorsForApi($this->_userForm->getErrors()));
                     }
                     }
-                    foreach ($decLevelConfig as $key => $val) {
-                        if ($totalPv >= $val['PERF']) {
-                            $toDecLevel = $key;
+
+                    $decResult = $this->addDecOrder();
+                    if (!$decResult) {
+                        throw new Exception(Form::formatErrorsForApi($decResult->getErrors()));
+                    }
+                    if($hasInstalment){
+                        if(!($instalmentResult = $this->insertInstalment($zcResult))) {
+                            throw new Exception(Form::formatErrorsForApi('h'));
                         }
                         }
                     }
                     }
-                    if ($this->decLv != $toDecLevel) {
-//                        if ($hasInstalment && $decLevel['LEVEL_NAME'] == 'Elite'){
-//                        }else{
-                            throw new Exception(Yii::t('app', 'totalBVCanNotLessThanNextSelectedLevelBV'));
+                    // todo: 3398代码块--off
+
+
+                    // todo: 3398代码块--on
+//                    if($totalPv<$decLevel['PERF']){
+////                        if ($hasInstalment && $decLevel['LEVEL_NAME'] == 'Elite'){
+////                        }else{
+//                            throw new Exception(Yii::t('app', 'totalBVCanNotLessThanSelectedBV'));
+////                        }
+//                    }
+//                    foreach ($decLevelConfig as $key => $val) {
+//                        if ($totalPv >= $val['PERF']) {
+//                            $toDecLevel = $key;
 //                        }
 //                        }
-                    }
+//                    }
+//                    if ($this->decLv != $toDecLevel) {
+////                        if ($hasInstalment && $decLevel['LEVEL_NAME'] == 'Elite'){
+////                        }else{
+//                            throw new Exception(Yii::t('app', 'totalBVCanNotLessThanNextSelectedLevelBV'));
+////                        }
+//                    }
+                    // todo: 3398代码块--on
+
+
                     $this->_decAmount = $totalAmount;
                     $this->_decAmount = $totalAmount;
                     $this->_decPv = $totalPv;
                     $this->_decPv = $totalPv;
                     $this->_decAmountStandard = $totalAmountStandard;
                     $this->_decAmountStandard = $totalAmountStandard;

+ 36 - 9
common/models/forms/DeclarationForm.php

@@ -716,11 +716,13 @@ class DeclarationForm extends Model
                         }
                         }
                     }
                     }
                 }
                 }
+
+                // todo: 3398代码块--off
                 if($totalPv<$decLevel['PERF']){
                 if($totalPv<$decLevel['PERF']){
-//                    if ($hasInstalment && $decLevel['LEVEL_NAME'] == 'Elite'){
-//                    }else{
+                    if ($hasInstalment && $decLevel['LEVEL_NAME'] == 'Elite'){
+                    }else{
                         throw new Exception(Yii::t('app', 'totalBVCanNotLessThanSelectedBV'));
                         throw new Exception(Yii::t('app', 'totalBVCanNotLessThanSelectedBV'));
-//                    }
+                    }
                 }
                 }
                 foreach ($decLevelConfig as $key=>$val){
                 foreach ($decLevelConfig as $key=>$val){
                     if($totalPv>=$val['PERF']){
                     if($totalPv>=$val['PERF']){
@@ -728,14 +730,39 @@ class DeclarationForm extends Model
                     }
                     }
                 }
                 }
                 if ($this->decLv != $toDecLevel) {
                 if ($this->decLv != $toDecLevel) {
-//                    if ($hasInstalment && $decLevel['LEVEL_NAME'] == 'Elite'){
-//                    }else{
-                        throw new Exception(Yii::t('app', 'totalBVCanNotLessThanNextSelectedLevelBV') . '-1');
-//                    }
+                    if ($hasInstalment && $decLevel['LEVEL_NAME'] == 'Elite'){
+                    }else{
+                        throw new Exception(Yii::t('app', 'totalBVCanNotLessThanNextSelectedLevelBV'));
+                    }
+                }
+                if ($hasInstalment && $decLevel['LEVEL_NAME'] == 'BA'){
+                    throw new Exception(Yii::t('app', 'totalBVCanNotLessThanNextSelectedLevelBV'));
                 }
                 }
-//                if ($hasInstalment && $decLevel['LEVEL_NAME'] == 'BA'){
-//                    throw new Exception(Yii::t('app', 'totalBVCanNotLessThanNextSelectedLevelBV'));
+                // todo: 3398代码块--off
+
+                // todo: 3398代码块--on
+//                if($totalPv<$decLevel['PERF']){
+////                    if ($hasInstalment && $decLevel['LEVEL_NAME'] == 'Elite'){
+////                    }else{
+//                        throw new Exception(Yii::t('app', 'totalBVCanNotLessThanSelectedBV'));
+////                    }
+//                }
+//                foreach ($decLevelConfig as $key=>$val){
+//                    if($totalPv>=$val['PERF']){
+//                        $toDecLevel = $key;
+//                    }
 //                }
 //                }
+//                if ($this->decLv != $toDecLevel) {
+////                    if ($hasInstalment && $decLevel['LEVEL_NAME'] == 'Elite'){
+////                    }else{
+//                        throw new Exception(Yii::t('app', 'totalBVCanNotLessThanNextSelectedLevelBV') . '-1');
+////                    }
+//                }
+////                if ($hasInstalment && $decLevel['LEVEL_NAME'] == 'BA'){
+////                    throw new Exception(Yii::t('app', 'totalBVCanNotLessThanNextSelectedLevelBV'));
+////                }
+                // todo: 3398代码块--on
+
                 $this->_decAmount = $totalAmount;
                 $this->_decAmount = $totalAmount;
                 $this->_decPv = $totalPv;
                 $this->_decPv = $totalPv;
                 $this->_decAmountStandard = $totalAmountStandard;
                 $this->_decAmountStandard = $totalAmountStandard;