Explorar o código

feat: NG-15: 新会员注册时增加国家与语言选项.

zhangl hai 1 ano
pai
achega
2218ad62e9

+ 21 - 13
backendApi/modules/v1/models/lists/user/IndexList.php

@@ -231,22 +231,30 @@ class IndexList extends \common\libs\dataList\DataList implements DataListInterf
                         'tag'=>['type'=>'warning', 'size' => 'small', 'class'=>'no-border']
                     ],
                 ],
-                'REC_USER_NAME' => [
+//                'REC_USER_NAME' => [
+//                    'header' => Yii::t('ctx', 'recommendationNo'),
+//                    'headerOther' => ['width' => '160'],
+//                ],
+//                'REC_REAL_NAME' => [
+//                    'header' => Yii::t('ctx', 'recommendedName'),
+//                    'headerOther' => ['width' => '160'],
+//                ],
+                'CON_USER_NAME_ACTUAL' => [
                     'header' => Yii::t('ctx', 'recommendationNo'),
-                    'headerOther' => ['width' => '160'],
+                    'headerOther' => ['width' => '140'],
                 ],
-                'REC_REAL_NAME' => [
+                'CON_REAL_NAME_ACTUAL' => [
                     'header' => Yii::t('ctx', 'recommendedName'),
-                    'headerOther' => ['width' => '160'],
+                    'headerOther' => ['width' => '140'],
+                ],
+                'CON_USER_NAME' => [
+                    'header' => Yii::t('ctx', 'placementNo'),
+                    'headerOther' => ['width' => '140'],
+                ],
+                'CON_REAL_NAME' => [
+                    'header' => Yii::t('ctx', 'placementName'),
+                    'headerOther' => ['width' => '140'],
                 ],
-//                'CON_USER_NAME' => [
-//                    'header' => Yii::t('ctx', 'placementNo'),
-//                    'headerOther' => ['width' => '140'],
-//                ],
-//                'CON_REAL_NAME' => [
-//                    'header' => Yii::t('ctx', 'placementName'),
-//                    'headerOther' => ['width' => '140'],
-//                ],
 //                'RELATIVE_LOCATION' => [
 //                    'header' => Yii::t('ctx', 'resettlementArea'),
 //                    'headerOther' => ['width' => '140'],
@@ -398,7 +406,7 @@ class IndexList extends \common\libs\dataList\DataList implements DataListInterf
                 'LAST_EMP_LV_NAME'=> ['name'=> Yii::t('ctx', 'latestDirector'), 'other'=> 'empLevel'],
                 'CROWN_LV_NAME'=> ['name'=> Yii::t('ctx', 'highestCrown'), 'other'=> 'crownLevel'],
                 'LAST_CROWN_LV_NAME'=> ['name'=> Yii::t('ctx', 'latestCrown'), 'other'=> 'crownLevel'],
-                'REC_USER_NAME'=> ['name'=> Yii::t('ctx', 'recommendationNo')],
+//                'REC_USER_NAME'=> ['name'=> Yii::t('ctx', 'recommendationNo')],
 //                'CON_USER_NAME'=> ['name'=> Yii::t('ctx', 'placementNo')],
                 'MOBILE'=> ['name'=> Yii::t('ctx', 'phoneNumber')],
                 'DEC_USER_NAME'=> ['name'=> Yii::t('ctx', 'stockistCode')],

+ 2 - 2
common/messages/zh-CN/ctx.php

@@ -564,8 +564,8 @@ return [
     'PCMemberLevel' => '结算时会员级别',
     'latestDirector' => '最新管理星级',
     'latestCrown' => '最新皇冠星级',
-    'recommendationNo' => '推荐编号',
-    'recommendedName' => '推荐姓名',
+    'recommendationNo' => '推荐编号',
+    'recommendedName' => '推荐姓名',
     'placementNo' => '实际推荐人编号',    // 安置编号
     'placementName' => '实际推荐人姓名',   // 安置姓名
     'resettlementArea' => '实际推荐区域', // 安置区域

+ 3 - 2
common/models/UserInfo.php

@@ -13,8 +13,9 @@ use common\libs\logging\operate\valueType\Config as ValueTypeConfig;
  * @property string $USER_ID 会员ID
  * @property string $USER_NAME 会员名
  * @property string $ZC_PV 注册单PV
- * @property string $CON_UID 接点人ID
- * @property string $REC_UID 推荐人ID
+ * @property string $CON_UID 实际推荐人ID
+ * @property string $CON_UID_ACTUAL 推荐人ID
+ * @property string $REC_UID 安置人ID
  * @property int $CON_NUM 下级节点数量
  * @property int $REC_NUM 开拓会员数量
  * @property int $NETWORK_DEEP 安置网络深度

+ 2 - 1
common/models/forms/ApproachDeclarationForm.php

@@ -642,7 +642,8 @@ class ApproachDeclarationForm extends Model
                 }
 
                 // 报单中心汇率
-                $decCountry = User::getEnCodeInfo(\Yii::$app->user->id)['COUNTRY_ID'];
+                $decCountryId = User::getEnCodeInfo(\Yii::$app->user->id)['COUNTRY_ID'];
+                $decCountry = Countries::getById($decCountryId);
                 $decUserCurrencyRate = CurrencyConversions::getToUSDRate($decCountry['LOCAL_CURRENCY_ID']);
                 // 升级会员汇率
                 $country = Countries::getById($this->countryId);

+ 51 - 51
common/models/forms/DeclarationForm.php

@@ -513,44 +513,44 @@ class DeclarationForm extends Model
             $conUser = $this->_tempParentUser[$this->conUserName];
 
             // 开拓人
-            if(!isset($this->_tempParentUser[$this->recUserName])){
-                $recUserTemp = UserInfo::findOneAsArray('USER_NAME=:USER_NAME', [':USER_NAME' => $this->recUserName]);
-                if(!$recUserTemp){
-//                    $this->addError($attribute, '为'.$this->insertUserName.'报单,开拓人'.$this->recUserName.'不存在');
-                    $this->addError($attribute, 'To'.$this->insertUserName.'Entry, Sponsor'.$this->recUserName.'not in exist');
-                    return ;
-                }
-                $recUserTemp['CON_NUM'] = UserNetwork::firstFloorChildNum($recUserTemp['USER_ID']);
-                $recUserTemp['REC_NUM'] = UserRelation::firstFloorChildNum($recUserTemp['USER_ID']);
-                $this->_tempParentUser[$this->recUserName] = [
-                    'USER_NAME' => $this->recUserName,
-                    //'ZC_PV' => $recUserTemp['ZC_PV'],
-                    'CON_USER_NAME' => Info::getUserNameByUserId($recUserTemp['CON_UID']),
-                    'REC_USER_NAME' => Info::getUserNameByUserId($recUserTemp['REC_UID']),
-                    'CON_NUM' => $recUserTemp['CON_NUM'],
-                    'REC_NUM' => $recUserTemp['REC_NUM'],
-                    'SYSTEM_ID' => $recUserTemp['SYSTEM_ID'],
-                    'LOCATION' => UserNetwork::getLocation($recUserTemp['USER_ID'], $recUserTemp['CON_UID']),
-                ];
-                // 把该会员下面的5个区是否存在会员都付上
-                for($i=1;$i<=5;$i++){
-                    $this->_tempParentUser[$this->recUserName]["LOCATION$i"] = UserNetwork::issetUserInLocation($recUserTemp['USER_ID'], $i);
-                }
-            }
-            $recUser = $this->_tempParentUser[$this->recUserName];
+//            if(!isset($this->_tempParentUser[$this->recUserName])){
+//                $recUserTemp = UserInfo::findOneAsArray('USER_NAME=:USER_NAME', [':USER_NAME' => $this->recUserName]);
+//                if(!$recUserTemp){
+////                    $this->addError($attribute, '为'.$this->insertUserName.'报单,开拓人'.$this->recUserName.'不存在');
+//                    $this->addError($attribute, 'To'.$this->insertUserName.'Entry, Sponsor'.$this->recUserName.'not in exist');
+//                    return ;
+//                }
+//                $recUserTemp['CON_NUM'] = UserNetwork::firstFloorChildNum($recUserTemp['USER_ID']);
+//                $recUserTemp['REC_NUM'] = UserRelation::firstFloorChildNum($recUserTemp['USER_ID']);
+//                $this->_tempParentUser[$this->recUserName] = [
+//                    'USER_NAME' => $this->recUserName,
+//                    //'ZC_PV' => $recUserTemp['ZC_PV'],
+//                    'CON_USER_NAME' => Info::getUserNameByUserId($recUserTemp['CON_UID']),
+//                    'REC_USER_NAME' => Info::getUserNameByUserId($recUserTemp['REC_UID']),
+//                    'CON_NUM' => $recUserTemp['CON_NUM'],
+//                    'REC_NUM' => $recUserTemp['REC_NUM'],
+//                    'SYSTEM_ID' => $recUserTemp['SYSTEM_ID'],
+//                    'LOCATION' => UserNetwork::getLocation($recUserTemp['USER_ID'], $recUserTemp['CON_UID']),
+//                ];
+//                // 把该会员下面的5个区是否存在会员都付上
+//                for($i=1;$i<=5;$i++){
+//                    $this->_tempParentUser[$this->recUserName]["LOCATION$i"] = UserNetwork::issetUserInLocation($recUserTemp['USER_ID'], $i);
+//                }
+//            }
+//            $recUser = $this->_tempParentUser[$this->recUserName];
 
             // 判断接点会员的下级会员是否大于三个,如果大于三个则不允许
-            if($conUser['CON_NUM'] >= 3){
-//                $this->addError($attribute, '为'.$this->insertUserName.'报单,指导老师'.$this->conUserName.'下级点位已满');
-                $this->addError($attribute, 'To'.$this->insertUserName.'Entry, Sponsor'.$this->conUserName.'lower level is full');
-                return;
-            }
-            // 判断指导老师相应的区位是否已满
-            if($conUser['LOCATION'.$this->location]){
-//                $this->addError($attribute, '为'.$this->insertUserName.'报单,指导老师'.$this->conUserName.'该市场已存在会员');
-                $this->addError($attribute, 'To'.$this->insertUserName.'Entry, Sponsor'.$this->conUserName.'Members already exist in this market');
-                return;
-            }
+//            if($conUser['CON_NUM'] >= 3){
+////                $this->addError($attribute, '为'.$this->insertUserName.'报单,指导老师'.$this->conUserName.'下级点位已满');
+//                $this->addError($attribute, 'To'.$this->insertUserName.'Entry, Sponsor'.$this->conUserName.'lower level is full');
+//                return;
+//            }
+//            // 判断指导老师相应的区位是否已满
+//            if($conUser['LOCATION'.$this->location]){
+////                $this->addError($attribute, '为'.$this->insertUserName.'报单,指导老师'.$this->conUserName.'该市场已存在会员');
+//                $this->addError($attribute, 'To'.$this->insertUserName.'Entry, Sponsor'.$this->conUserName.'Members already exist in this market');
+//                return;
+//            }
 //            if($conUser['CON_NUM'] == 0 && $this->location != 1){
 //                $this->addError($attribute, '为'.$this->insertUserName.'报单,市场必须为指导老师'.$this->conUserName.'下第一市场');
 //                return;
@@ -562,21 +562,21 @@ class DeclarationForm extends Model
 //            $this->_tempParentUser[$this->recUserName]['REC_NUM'] += 1;
 
             // 把自己加入到临时上级会员数组中
-            $this->_tempParentUser[$this->insertUserName] = [
-                'USER_NAME' => $this->insertUserName,
-                //'ZC_PV' => $this->decPv,
-                'CON_USER_NAME' => $this->conUserName,
-                'REC_USER_NAME' => $this->recUserName,
-                'CON_NUM' => 0,
-                'REC_NUM' => 0,
-                'SYSTEM_ID' => $recUser['SYSTEM_ID'],
-                'LOCATION' => $this->location,
-                'LOCATION1' => 0,
-                'LOCATION2' => 0,
-                'LOCATION3' => 0,
-                'LOCATION4' => 0,
-                'LOCATION5' => 0,
-            ];
+//            $this->_tempParentUser[$this->insertUserName] = [
+//                'USER_NAME' => $this->insertUserName,
+//                //'ZC_PV' => $this->decPv,
+//                'CON_USER_NAME' => $this->conUserName,
+//                'REC_USER_NAME' => $this->recUserName,
+//                'CON_NUM' => 0,
+//                'REC_NUM' => 0,
+//                'SYSTEM_ID' => $recUser['SYSTEM_ID'],
+//                'LOCATION' => $this->location,
+//                'LOCATION1' => 0,
+//                'LOCATION2' => 0,
+//                'LOCATION3' => 0,
+//                'LOCATION4' => 0,
+//                'LOCATION5' => 0,
+//            ];
         }
     }
 

+ 4 - 2
common/models/forms/UserForm.php

@@ -28,6 +28,7 @@ class UserForm extends Model
     public $zcPv;
     public $zcAmount;
     public $conUserName;
+    public $conUserNameActual;
     public $recUserName;
     public $conUid;
     public $recUid;
@@ -100,7 +101,7 @@ class UserForm extends Model
             [['recUserName'], 'exist', 'targetClass'=>UserInfo::class, 'targetAttribute'=>'USER_NAME', 'on' => ['addWithUserName', 'addWithUid', 'addByAdmin']],
             [['conUserName'], 'isCon', 'on' => ['addWithUserName', 'addWithUid', 'addByAdmin']],
             [['recUserName'], 'isRec', 'on' => ['addWithUserName', 'addWithUid', 'addByAdmin']],
-            [['location'], 'isLocation', 'on' => ['addWithUserName', 'addWithUid', 'addByAdmin']],
+//            [['location'], 'isLocation', 'on' => ['addWithUserName', 'addWithUid', 'addByAdmin']],
             //[['idCard'], 'isSameNetwork'],
             [['zcPv', 'zcAmount'], 'price', 'on' => ['addWithUserName', 'addWithUid', 'addByAdmin']],
             [['zcPv'], 'isMinDecLevel', 'on' => ['addWithUserName', 'addWithUid', 'addByAdmin']],
@@ -312,7 +313,8 @@ class UserForm extends Model
             $userInfoModel->USER_NAME = $insertUserName;
             $userInfoModel->ZC_PV = $zcPv;
             $userInfoModel->ZC_AMOUNT = $this->zcAmount;
-            $userInfoModel->CON_UID = $conUid;
+            $userInfoModel->CON_UID = $recUid;
+            $userInfoModel->CON_UID_ACTUAL = $conUid;
             $userInfoModel->REC_UID = $recUid;
             $userInfoModel->SYSTEM_ID = $conUserInfo['SYSTEM_ID'];
             //$userInfoModel->PERIOD_NUM = $nowPeriodNum;