|
|
@@ -67,6 +67,7 @@ class ApproachDeclarationForm extends Model
|
|
|
public $cityName;
|
|
|
public $lgaName;
|
|
|
public $payType;
|
|
|
+ public $decType;
|
|
|
|
|
|
// 传过来的全部数据
|
|
|
public $allData;
|
|
|
@@ -127,7 +128,7 @@ class ApproachDeclarationForm extends Model
|
|
|
[['type','decLv','decWay','insertUserName',/* 'insertUserIdCard',*/'password','payPassword','decUserName'], 'required'],
|
|
|
[['type'], 'isType', 'on'=>['userDec', 'canDec']],
|
|
|
[['insertUserName'], 'isCanAddUser'],
|
|
|
- [['decUserName'], 'issetDec'],
|
|
|
+ [['decUserName', 'decType'], 'issetDec'],
|
|
|
[['conUserName'], 'isConUserName'],
|
|
|
[['recUserName'], 'isRecUserName'],
|
|
|
[['location'], 'isLocation'],
|
|
|
@@ -181,8 +182,8 @@ class ApproachDeclarationForm 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'],
|
|
|
- 'canDec' => ['type', 'insertUserName',/* 'insertUserIdCard',*/ 'conUserName', 'recUserName', 'location'],
|
|
|
+ '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', 'decType'],
|
|
|
+ 'canDec' => ['type', 'insertUserName',/* 'insertUserIdCard',*/ 'conUserName', 'recUserName', 'location', 'decType'],
|
|
|
'notFull' => ['type', 'insertUserName', 'conUserName', 'recUserName', 'location'],
|
|
|
];
|
|
|
return array_merge($parentScenarios, $customScenarios);
|
|
|
@@ -197,19 +198,19 @@ class ApproachDeclarationForm extends Model
|
|
|
$this->addError($attribute, 'Stockist does not exist');//报单中心不存在
|
|
|
return false;
|
|
|
} else {
|
|
|
- // 判断报单中心是否在新加入会员的安置网上级中
|
|
|
- $this->loopFindParentToNetwork($this->insertUserName);
|
|
|
- //反转数组,in_array搜索错误
|
|
|
- //in_array($this->decUserName, $this->_tempNetworkParentUser[$this->insertUserName]);
|
|
|
- $flipParent = array_flip(array_filter($this->_tempNetworkParentUser[$this->insertUserName]));
|
|
|
-// var_dump($flipParent);
|
|
|
-// echo $this->insertUserName.'=='.$this->decUserName;
|
|
|
-// exit;
|
|
|
- if (!isset($flipParent[$this->decUserName])) {
|
|
|
- //$this->addError($attribute, '为' . $this->insertUserName . '报单,报单中心' . $this->decUserName . '不在' . $this->insertUserName . '的安置网上级中');
|
|
|
- $this->addError($attribute, 'To' . $this->insertUserName . 'Entry, Stockist' . $this->decUserName . 'not in exist' . $this->insertUserName . 'in the placement superiors');
|
|
|
- return ;
|
|
|
+ if ($this->decType !== 'ba') {
|
|
|
+ // 判断报单中心是否在新加入会员的安置网上级中
|
|
|
+ $this->loopFindParentToNetwork($this->insertUserName);
|
|
|
+ //反转数组,in_array搜索错误
|
|
|
+ //in_array($this->decUserName, $this->_tempNetworkParentUser[$this->insertUserName]);
|
|
|
+ $flipParent = array_flip(array_filter($this->_tempNetworkParentUser[$this->insertUserName]));
|
|
|
+ if (!isset($flipParent[$this->decUserName])) {
|
|
|
+ //$this->addError($attribute, '为' . $this->insertUserName . '报单,报单中心' . $this->decUserName . '不在' . $this->insertUserName . '的安置网上级中');
|
|
|
+ $this->addError($attribute, 'To' . $this->insertUserName . 'Entry, Stockist' . $this->decUserName . 'not in exist' . $this->insertUserName . 'in the placement superiors');
|
|
|
+ return ;
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
$this->_decId = $decUser['ID'];
|
|
|
}
|
|
|
}
|
|
|
@@ -325,7 +326,7 @@ class ApproachDeclarationForm extends Model
|
|
|
$this->_tempParentUser[$this->recUserName]['REC_NUM'] += 1;
|
|
|
|
|
|
// 存在新加入会员时查看开拓人是否在新加入会员的安置网上级中
|
|
|
- if($this->insertUserName) {
|
|
|
+ if($this->decType !== 'ba' && $this->insertUserName) {
|
|
|
$this->loopFindParentToNetwork($this->insertUserName);
|
|
|
if (!$this->recUserIsInNetworkParent()) {
|
|
|
// $this->addError($attribute, '为' . $this->insertUserName . '报单,开拓人' . $this->recUserName . '不在' . $this->insertUserName . '的安置网上级中');
|