|
|
@@ -123,10 +123,10 @@ class DeclarationForm extends Model
|
|
|
{
|
|
|
return [
|
|
|
[['type','decLv','decWay','packageId', 'insertUserName', 'realName',/* 'insertUserIdCard',*/ 'mobile', 'address', 'openBank', 'bankAddress', 'bankNo','bankProvince','bankCity','bankCounty','consignee','acceptMobile','province','city','county','cityName','lgaName','decUserName', 'conUserName', 'recUserName', 'location'], 'trim'],
|
|
|
- [['type','decLv','decWay','insertUserName',/* 'insertUserIdCard',*/'password','payPassword','decUserName'], 'required'],
|
|
|
+ [['type','decLv','decWay','insertUserName',/* 'insertUserIdCard',*/'password','payPassword'], 'required'],
|
|
|
[['type'], 'isType', 'on'=>['userDec', 'canDec']],
|
|
|
[['insertUserName'], 'isCanAddUser'],
|
|
|
- [['decUserName'], 'issetDec'],
|
|
|
+// [['decUserName'], 'issetDec'],
|
|
|
[['conUserName'], 'isConUserName'],
|
|
|
[['recUserName'], 'isRecUserName'],
|
|
|
[['location'], 'isLocation'],
|
|
|
@@ -180,7 +180,7 @@ class DeclarationForm extends Model
|
|
|
{
|
|
|
$parentScenarios = parent::scenarios();
|
|
|
$customScenarios = [
|
|
|
- 'userDec' => ['type','allData', 'decLv','decWay','insertUserName','password','payPassword', 'realName',/* 'insertUserIdCard',*/ 'mobile', 'address', 'openBank', 'bankAddress', 'bankNo', 'bankProvince','bankCity','bankCounty', 'consignee','acceptMobile','province',/*'city','county',*/ 'conUserName', 'recUserName','decUserName', 'location', 'email'],
|
|
|
+ 'userDec' => ['type','allData', 'decLv','decWay','insertUserName','password','payPassword', 'realName',/* 'insertUserIdCard',*/ 'mobile', 'address', 'openBank', 'bankAddress', 'bankNo', 'bankProvince','bankCity','bankCounty', 'consignee','acceptMobile','province',/*'city','county',*/ 'conUserName', 'recUserName',/*'decUserName',*/ 'location', 'email'],
|
|
|
'canDec' => ['type', 'insertUserName',/* 'insertUserIdCard',*/ 'conUserName', 'recUserName', 'location'],
|
|
|
'notFull' => ['type', 'insertUserName', 'conUserName', 'recUserName', 'location'],
|
|
|
];
|
|
|
@@ -630,6 +630,7 @@ class DeclarationForm extends Model
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
+ $hasInstalment = 0;
|
|
|
// 首购单,需要添加会员操作
|
|
|
if($this->type == self::TYPE_ZC){
|
|
|
if (preg_match("/[\x7f-\xff]/", $this->insertUserName)) { //判断字符串中是否有中文
|
|
|
@@ -670,7 +671,6 @@ class DeclarationForm extends Model
|
|
|
$totalAmount = 0;
|
|
|
$totalAmountStandard = 0;
|
|
|
$totalPv = 0;
|
|
|
- $hasInstalment = 0;
|
|
|
$exchangeRate = floatval(Cache::getSystemConfig()['exchangeRate']['VALUE'] ?? 0); // 汇率
|
|
|
foreach ($this->goodsNum as $k => $v) {
|
|
|
if ($v) {
|
|
|
@@ -711,10 +711,10 @@ class DeclarationForm extends Model
|
|
|
}
|
|
|
}
|
|
|
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']){
|
|
|
@@ -722,14 +722,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'));
|
|
|
+// 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'));
|
|
|
+// }
|
|
|
$this->_decAmount = $totalAmount;
|
|
|
$this->_decPv = $totalPv;
|
|
|
$this->_decAmountStandard = $totalAmountStandard;
|