kevin_zhangl 2 лет назад
Родитель
Сommit
0808fa4a99

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

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

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

@@ -717,12 +717,11 @@ class DeclarationForm extends Model
                     }
                 }
 
-                // todo: 3398代码块--off
                 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'));
-                    }
+//                    }
                 }
                 foreach ($decLevelConfig as $key=>$val){
                     if($totalPv>=$val['PERF']){
@@ -730,38 +729,14 @@ class DeclarationForm extends Model
                     }
                 }
                 if ($this->decLv != $toDecLevel) {
-                    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'));
-                }
-                // 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 ($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'));
 //                }
-//                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->_decPv = $totalPv;