|
|
@@ -116,15 +116,15 @@ class DeclarationForm extends Model
|
|
|
public function rules()
|
|
|
{
|
|
|
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','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'], 'isType', 'on'=>['userDec', 'canDec']],
|
|
|
[['insertUserName'], 'isCanAddUser'],
|
|
|
[['decUserName'], 'issetDec'],
|
|
|
[['conUserName'], 'isConUserName'],
|
|
|
[['recUserName'], 'isRecUserName'],
|
|
|
[['location'], 'isLocation'],
|
|
|
- [['insertUserIdCard'], 'isSameSystem'],
|
|
|
+// [['insertUserIdCard'], 'isSameSystem'],
|
|
|
];
|
|
|
}
|
|
|
|
|
|
@@ -174,8 +174,8 @@ 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'],
|
|
|
- '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'],
|
|
|
+ 'canDec' => ['type', 'insertUserName',/* 'insertUserIdCard',*/ 'conUserName', 'recUserName', 'location'],
|
|
|
'notFull' => ['type', 'insertUserName', 'conUserName', 'recUserName', 'location'],
|
|
|
];
|
|
|
return array_merge($parentScenarios, $customScenarios);
|
|
|
@@ -566,7 +566,7 @@ class DeclarationForm extends Model
|
|
|
if(!$this->insertUserName) $this->addError($attribute, 'Membership number must be filled in for initial purchase');//首购必须填写加入会员编号
|
|
|
}
|
|
|
if(!$this->insertUserName) $this->addError($attribute, 'Membership number must be filled in for initial purchase');//首购必须填写加入会员编号
|
|
|
- if(!$this->insertUserIdCard) $this->addError($attribute, 'For the first purchase, the ID number of the member must be filled in');//首购必须填写加入会员的身份证号
|
|
|
+// if(!$this->insertUserIdCard) $this->addError($attribute, 'For the first purchase, the ID number of the member must be filled in');//首购必须填写加入会员的身份证号
|
|
|
if(!$this->conUserName) $this->addError($attribute, 'For the first purchase, you must fill in the instructor number of the member');//首购必须填写加入会员的指导老师编号
|
|
|
if(!$this->recUserName) $this->addError($attribute, 'For the first purchase, the pioneer number of the member must be filled in');//首购必须填写加入会员的开拓人编号
|
|
|
if(!$this->location) $this->addError($attribute, 'The first purchase must be filled in the market of the member');//首购必须填写加入会员的市场
|
|
|
@@ -580,33 +580,33 @@ class DeclarationForm extends Model
|
|
|
* 检验相同身份证 会员是否同一体系内(接点)
|
|
|
* @param $attribute
|
|
|
*/
|
|
|
- public function isSameSystem($attribute){
|
|
|
- if(isset($this->_tempParentUser[$this->conUserName])){
|
|
|
- // 新加入会员的身份证号对应网内的其他会员
|
|
|
- $otherUser = User::findAllAsArray("ID_CARD=:ID_CARD AND IS_UNION=0 AND DELETED=0 AND (ID_CARD_PREFIX IS NULL OR ID_CARD_PREFIX='')", [':ID_CARD'=>$this->insertUserIdCard]);
|
|
|
- if(count($otherUser)>=7){
|
|
|
- $this->addError($attribute, 'Only 7 documents can be reported for the same ID card');//同一个身份证限制只能报7单
|
|
|
- }
|
|
|
- if($otherUser){
|
|
|
- $flipParent = array_flip(array_filter($this->_tempNetworkParentUser[$this->insertUserName]));
|
|
|
- $isExsit = false;
|
|
|
- foreach ($otherUser as $conUser){
|
|
|
- if(isset($flipParent[$conUser['USER_NAME']])){
|
|
|
- $isExsit = true;
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- if (!$isExsit) {
|
|
|
-// $this->addError($attribute, '为' . $this->insertUserName . '报单,身份证号码相同的会员'.$otherUser[0]['USER_NAME'].'不在' . $this->insertUserName . '的安置网上级中');
|
|
|
- $this->addError($attribute, 'To' . $this->insertUserName . 'Entry,Members with the same ID number'.$otherUser[0]['USER_NAME'].'not in exist' . $this->insertUserName . 'in the placement superiors');
|
|
|
- return ;
|
|
|
- }
|
|
|
- }
|
|
|
- } else {
|
|
|
-// $this->addError($attribute, '为'.$this->insertUserName.'报单,接点人'.$this->conUserName.'不存在');
|
|
|
- $this->addError($attribute, 'To'.$this->insertUserName.'Entry,Contact person'.$this->conUserName.'not in exist');
|
|
|
- }
|
|
|
- }
|
|
|
+// public function isSameSystem($attribute){
|
|
|
+// if(isset($this->_tempParentUser[$this->conUserName])){
|
|
|
+// // 新加入会员的身份证号对应网内的其他会员
|
|
|
+// $otherUser = User::findAllAsArray("ID_CARD=:ID_CARD AND IS_UNION=0 AND DELETED=0 AND (ID_CARD_PREFIX IS NULL OR ID_CARD_PREFIX='')", [':ID_CARD'=>$this->insertUserIdCard]);
|
|
|
+// if(count($otherUser)>=7){
|
|
|
+// $this->addError($attribute, 'Only 7 documents can be reported for the same ID card');//同一个身份证限制只能报7单
|
|
|
+// }
|
|
|
+// if($otherUser){
|
|
|
+// $flipParent = array_flip(array_filter($this->_tempNetworkParentUser[$this->insertUserName]));
|
|
|
+// $isExsit = false;
|
|
|
+// foreach ($otherUser as $conUser){
|
|
|
+// if(isset($flipParent[$conUser['USER_NAME']])){
|
|
|
+// $isExsit = true;
|
|
|
+// break;
|
|
|
+// }
|
|
|
+// }
|
|
|
+// if (!$isExsit) {
|
|
|
+//// $this->addError($attribute, '为' . $this->insertUserName . '报单,身份证号码相同的会员'.$otherUser[0]['USER_NAME'].'不在' . $this->insertUserName . '的安置网上级中');
|
|
|
+// $this->addError($attribute, 'To' . $this->insertUserName . 'Entry,Members with the same ID number'.$otherUser[0]['USER_NAME'].'not in exist' . $this->insertUserName . 'in the placement superiors');
|
|
|
+// return ;
|
|
|
+// }
|
|
|
+// }
|
|
|
+// } else {
|
|
|
+//// $this->addError($attribute, '为'.$this->insertUserName.'报单,接点人'.$this->conUserName.'不存在');
|
|
|
+// $this->addError($attribute, 'To'.$this->insertUserName.'Entry,Contact person'.$this->conUserName.'not in exist');
|
|
|
+// }
|
|
|
+// }
|
|
|
|
|
|
/**
|
|
|
* 添加报单
|
|
|
@@ -718,7 +718,7 @@ class DeclarationForm extends Model
|
|
|
$user->PAY_PASSWORD = \Yii::$app->security->generatePasswordHash($this->payPassword);
|
|
|
$user->NATION = 0;
|
|
|
$user->REAL_NAME = $this->realName;
|
|
|
- $user->ID_CARD = $this->insertUserIdCard;
|
|
|
+ $user->ID_CARD = $this->mobile;
|
|
|
$user->MOBILE = $this->mobile;
|
|
|
$user->EMAIL = $this->email;
|
|
|
$user->ADDRESS = $this->address ? $this->address : 'nothing';//无
|
|
|
@@ -762,7 +762,7 @@ class DeclarationForm extends Model
|
|
|
$userForm->conUserName = $this->conUserName;
|
|
|
$userForm->recUserName = $this->recUserName;
|
|
|
$userForm->location = $this->location;
|
|
|
- $userForm->idCard = $this->insertUserIdCard;
|
|
|
+ $userForm->idCard = $this->mobile;
|
|
|
$userForm->allData = $allData;
|
|
|
if(!$userForm->validate()){
|
|
|
$this->addErrors($userForm->getErrors());
|