Ver código fonte

BA会员修改

kevin_zhangl 3 anos atrás
pai
commit
b3e7be8ea3

+ 2 - 182
backendApi/modules/v1/models/lists/shop/BaUserList.php

@@ -12,6 +12,7 @@ use common\models\BaUser;
 use common\models\BaUserInfo;
 use common\libs\dataList\column\DateTime;
 use common\libs\dataList\column\YesNo;
+use common\models\User;
 use common\models\UserNetwork;
 use common\models\UserSystem;
 use Yii;
@@ -41,7 +42,6 @@ class BaUserList extends \common\libs\dataList\DataList implements DataListInter
                 UI.HIGHEST_EMP_LV, UI.CLOSE_LOGIN_AT, UI.PULLED_AT, 
                 UI.GROUP_LEADER_AT, UI.ALLOW_TRANSFER, UI.ALLOW_RECONSUME_SMS, UI.ALLOW_RECONSUME_SMS_TO, 
                 UI.HIGHEST_EMP_LV_PERIOD, UI.TRANSFER_PROP, UI.LOGIN_NUMS, UI.FAIL_NUMS, UI.LAST_LOGIN_IP, 
-                CU.USER_NAME CON_USER_NAME,CU.REAL_NAME CON_REAL_NAME,
                 RU.USER_NAME REC_USER_NAME,RU.REAL_NAME REC_REAL_NAME,
                 DU.USER_NAME DEC_USER_NAME
                 ',
@@ -49,9 +49,7 @@ class BaUserList extends \common\libs\dataList\DataList implements DataListInter
             'from' => BaUser::tableName() . ' AS U',
             'join' => [
                 ['LEFT JOIN', BaUserInfo::tableName() . ' AS UI', 'UI.USER_ID=U.ID'],
-//                ['LEFT JOIN', UserNetwork::tableName() . ' AS UN', 'UI.USER_ID=UN.USER_ID'],
-                ['LEFT JOIN', BaUser::tableName() . ' AS CU', 'UI.CON_UID=CU.ID'],
-                ['LEFT JOIN', BaUser::tableName() . ' AS RU', 'UI.REC_UID=RU.ID'],
+                ['LEFT JOIN', User::tableName() . ' AS RU', 'UI.REC_UID=RU.ID'],
                 ['LEFT JOIN', BaUser::tableName() . ' AS DU', 'U.DEC_ID=DU.ID'],
             ],
             'page' => $this->page,
@@ -78,12 +76,6 @@ class BaUserList extends \common\libs\dataList\DataList implements DataListInter
      * @return array
      */
     public function getColumn(){
-//        $decLevelConfig = Cache::getDecLevelConfig();
-//        $empLevelConfig = Cache::getEmpLevelConfig();
-//        $crownLevelConfig = Cache::getStarCrownLevelConfig();
-//        $decRoleConfig = DecRole::getAllData();
-//        $systemConfig = UserSystem::getAllSystems();
-        $openBankConfig = OpenBank::getAllOpenBank();
         $regionConfig = Cache::getRegionConfig();
         if(!$this->columns){
             $this->columns = [
@@ -129,67 +121,6 @@ class BaUserList extends \common\libs\dataList\DataList implements DataListInter
 //                'PERIOD_AT' => [
 //                    'header' => 'Joining Period',//加入期数
 //                    'headerOther' => ['width' => '180'],
-//                ],
-//                'DEC_LV_NAME' => [
-//                    'header' => 'Real time membership level',//实时会员级别
-//                    'headerOther' => [
-//                        'width' => '120',
-//                    ],
-//                    'value' => function($row) use($decLevelConfig) {
-//                        return $decLevelConfig[$row['DEC_LV']]['LEVEL_NAME'];
-//                    },
-//                    'valueOther' => [
-//                        'tag'=>['type'=>'warning', 'size' => 'small', 'class'=>'no-border']
-//                    ],
-//                ],
-//                'DEC_LV_UPDATED_AT' => [
-//                    'header' => 'Real time adjustment date',//实时调整日期
-//                    'value' => function($row) {
-//                        return (new DateTime([
-//                            'value' => $row['DEC_LV_UPDATED_AT'],
-//                        ]))->result();
-//                    },
-//                    'headerOther' => ['width' => '160'],
-//                ],
-//                'LAST_DEC_LV_NAME' => [
-//                    'header' => 'PC Member Level', // 结算时会员级别
-//                    'headerOther' => [
-//                        'width' => '120',
-//                    ],
-//                    'value' => function($row) use($decLevelConfig) {
-//                        if (!$row['LAST_DEC_LV']) {
-//                            return $decLevelConfig[$row['DEC_LV']]['LEVEL_NAME'];
-//                        } else {
-//                            return $decLevelConfig[$row['LAST_DEC_LV']]['LEVEL_NAME'];
-//                        }
-//                    },
-//                    'valueOther' => [
-//                        'tag'=>['type'=>'warning', 'size' => 'small', 'class'=>'no-border']
-//                    ],
-//                ],
-//                'EMP_LV_NAME' => [
-//                    'header' => 'Real time employment',//实时聘级
-//                    'headerOther' => [
-//                        'width' => '130',
-//                    ],
-//                    'value' => function($row) use($empLevelConfig) {
-//                        return isset($empLevelConfig[$row['EMP_LV']])?$empLevelConfig[$row['EMP_LV']]['LEVEL_NAME']:'';
-//                    },
-//                    'valueOther' => [
-//                        'tag'=>['type'=>'warning', 'size' => 'small', 'class'=>'no-border']
-//                    ],
-//                ],
-//                'CROWN_LV_NAME' => [
-//                    'header' => 'Real time crown', // 实时星级
-//                    'headerOther' => [
-//                        'width' => '130',
-//                    ],
-//                    'value' => function($row) use($crownLevelConfig) {
-//                        return isset($crownLevelConfig[$row['CROWN_LV']])?$crownLevelConfig[$row['CROWN_LV']]['LEVEL_NAME']:'';
-//                    },
-//                    'valueOther' => [
-//                        'tag'=>['type'=>'warning', 'size' => 'small', 'class'=>'no-border']
-//                    ],
 //                ],
                 'REC_USER_NAME' => [
                     'header' => 'Recommendation No',//推荐编号
@@ -199,14 +130,6 @@ class BaUserList extends \common\libs\dataList\DataList implements DataListInter
                     'header' => 'Recommended Name',//推荐姓名
                     'headerOther' => ['width' => '100'],
                 ],
-//                'CON_USER_NAME' => [
-//                    'header' => 'Placement No',//安置编号
-//                    'headerOther' => ['width' => '150'],
-//                ],
-//                'CON_REAL_NAME' => [
-//                    'header' => 'Placement Name',//安置姓名
-//                    'headerOther' => ['width' => '100'],
-//                ],
                 'MOBILE' => [
                     'header' => 'Phone Number',//手机号码
                     'value' => function($row) {
@@ -221,85 +144,6 @@ class BaUserList extends \common\libs\dataList\DataList implements DataListInter
                     },
                     'headerOther' => ['width' => '120'],
                 ],
-//                'DEC_USER_NAME' => [
-//                    'header' => 'Stockist Code', // 所属报单中心编号
-//                    'headerOther' => ['width' => '150'],
-//                ],
-//                'IS_DEC' => [
-//                    'header' => 'Declaration center or not',//是否报单中心
-//                    'value' => function($row) {
-//                        return (new YesNo([
-//                            'value' => $row['IS_DEC'],
-//                        ]))->result();
-//                    },
-//                    'headerOther' => function($row) {
-//                        return [
-//                            'width' => '120',
-//                        ];
-//                    },
-//                    'valueOther' => function($row) {
-//                        return [
-//                            'tag'=>['type'=>(isset($row['IS_DEC']) && $row['IS_DEC'] )? 'success' : 'info', 'size' => 'small']
-//                        ];
-//                    },
-//                ],
-//                'IS_ATLAS' => [
-//                    'header' => 'Whether the atlas is displayed',//是否显示图谱
-//                    'value' => function($row) {
-//                        return (new YesNo([
-//                            'value' => $row['IS_ATLAS'],
-//                        ]))->result();
-//                    },
-//                    'headerOther' => function($row) {
-//                        return [
-//                            'width' => '120',
-//                        ];
-//                    },
-//                    'valueOther' => function($row) {
-//                        return [
-//                            'tag'=>['type'=>(isset($row['IS_ATLAS']) && $row['IS_ATLAS'] )? 'success' : 'info', 'size' => 'small']
-//                        ];
-//                    },
-//                ],
-//                'IS_RECHARGE' => [
-//                    'header' => 'Whether to display recharge',//是否显示充值
-//                    'value' => function($row) {
-//                        return (new YesNo([
-//                            'value' => $row['IS_RECHARGE'],
-//                        ]))->result();
-//                    },
-//                    'headerOther' => function($row) {
-//                        return [
-//                            'width' => '120',
-//                        ];
-//                    },
-//                    'valueOther' => function($row) {
-//                        return [
-//                            'tag'=>['type'=>(isset($row['IS_RECHARGE']) && $row['IS_RECHARGE'] )? 'success' : 'info', 'size' => 'small']
-//                        ];
-//                    },
-//                ],
-//                'DEC_ROLE_NAME' => [
-//                    'header' => 'Stockist Level',//报单中心级别
-//                    'headerOther' => ['width' => '110'],
-//                    'value' => function($row) use($decRoleConfig) {
-//                        return $decRoleConfig[$row['DEC_ROLE_ID']]['ROLE_NAME'] ?? '';
-//                    },
-//                ],
-//                'OPEN_BANK_NAME' => [
-//                    'header' => 'Bank Name',//开户银行
-//                    'headerOther' => ['width' => '110'],
-//                    'value' => function($row) use($openBankConfig) {
-//                        return $openBankConfig[$row['OPEN_BANK']]['BANK_NAME'] ?? '';
-//                    },
-//                ],
-//                'BANK_NO' => [
-//                    'header' => 'Bank account number',//银行帐号
-//                    'headerOther' => ['width' => '220'],
-//                    'value' => function($row) {
-//                        return "\t".$row['BANK_NO'];
-//                    },
-//                ],
                 'AREA' => [
                     'header' => 'Common address',//常用地址
                     'value' => function($row) use($regionConfig) {
@@ -318,22 +162,6 @@ class BaUserList extends \common\libs\dataList\DataList implements DataListInter
                         'width' => '200'
                     ],
                 ],
-//                'ALLOW_TRANSFER' => [
-//                    'header' => 'Enable "Transfer"', // 转账功能开启
-//                    'value' => function($row) {
-//                        return $row['ALLOW_TRANSFER'] == 1 ? 'on': 'off';//'开启' : '关闭'
-//                    },
-//                    'headerOther' => function($row) {
-//                        return [
-//                            'width' => '120',
-//                        ];
-//                    },
-//                    'valueOther' => function($row) {
-//                        return [
-//                            'tag'=>['type'=>(isset($row['ALLOW_TRANSFER']) && $row['ALLOW_TRANSFER']) ? 'success' : 'info', 'size' => 'small']
-//                        ];
-//                    },
-//                ],
             ];
         }
         return $this->columns;
@@ -351,17 +179,9 @@ class BaUserList extends \common\libs\dataList\DataList implements DataListInter
                 'REAL_NAME'=> ['name'=> 'Member name'], // 会员姓名
                 'CREATED_AT'=> ['name'=> 'Joining Date', 'other'=> 'date'], // 加入日期
                 'PERIOD_AT'=> ['name'=> 'Joining Period'], // 加入期数
-//                'DEC_LV_NAME'=> ['name'=> 'Real time membership level', 'other'=> 'decLevel'], // 实时会员级别
-//                'EMP_LV_NAME'=> ['name'=> 'Real time employment', 'other'=> 'empLevel'], // 实时聘级
-//                'CROWN_LV_NAME'=> ['name'=> 'Real time Crown', 'other'=> 'crownLevel'], // 实时聘级
                 'REC_USER_NAME'=> ['name'=> 'Recommendation No'],//推荐编号
                 'CON_USER_NAME'=> ['name'=> 'Placement No'],//安置编号
-//                'ID_CARD'=> ['name'=> 'Identification Number'],//证件号码
                 'MOBILE'=> ['name'=> 'Phone Number'],//手机号码
-//                'DEC_USER_NAME'=> ['name'=> 'Stockist Code'], // 所属报单中心编号
-//                'IS_DEC'=> ['name'=> 'Declaration center or not', 'other'=> 'yesOrNo'],//是否报单中心
-//                'IS_STUDIO'=> ['name'=> 'Studio or not', 'other'=> 'yesOrNo'],//是否工作室
-//                'DEC_ROLE_NAME'=> ['name'=> 'Stockist Level', 'other'=> 'decRole'],//报单中心级别
                 'AREA'=> ['name'=> 'Common address', 'other'=> 'area'],//常用地址
                 'STATUS'=> ['name'=> 'Active status', 'other'=> 'select', 'selectData'=> [['id'=> 0, 'name'=> 'locking'],['id'=> 1, 'name'=> 'activation']]],
             ];

+ 4 - 23
backendApi/modules/v1/models/lists/user/BaUserList.php

@@ -36,38 +36,19 @@ class BaUserList extends \common\libs\dataList\DataList implements DataListInter
                 UI.HIGHEST_EMP_LV, UI.CLOSE_LOGIN_AT, UI.PULLED_AT, 
                 UI.GROUP_LEADER_AT, UI.ALLOW_TRANSFER, UI.ALLOW_RECONSUME_SMS, UI.ALLOW_RECONSUME_SMS_TO, 
                 UI.HIGHEST_EMP_LV_PERIOD, UI.TRANSFER_PROP, UI.LOGIN_NUMS, UI.FAIL_NUMS, UI.LAST_LOGIN_IP, 
-                UI.LAST_LOGIN_AT, UI.SHOW_EMP_LV,UN.RELATIVE_LOCATION
-                ',
-//            CU.USER_NAME CON_USER_NAME,CU.REAL_NAME CON_REAL_NAME,
-//                RU.USER_NAME REC_USER_NAME,RU.REAL_NAME REC_REAL_NAME,
-//                DU.USER_NAME DEC_USER_NAME
+                UI.LAST_LOGIN_AT,
+                RU.USER_NAME REC_USER_NAME,RU.REAL_NAME REC_REAL_NAME,
+                DU.USER_NAME DEC_USER_NAME',
             'orderBy' => 'UI.CREATED_AT DESC, UI.ID DESC',
             'from' => BaUser::tableName() . ' AS U',
             'join' => [
                 ['LEFT JOIN', BaUserInfo::tableName() . ' AS UI', 'UI.USER_ID=U.ID'],
-                ['LEFT JOIN', UserNetwork::tableName() . ' AS UN', 'UI.USER_ID=UN.USER_ID'],
-                ['LEFT JOIN', User::tableName() . ' AS CU', 'UI.CON_UID=CU.ID'],
                 ['LEFT JOIN', User::tableName() . ' AS RU', 'UI.REC_UID=RU.ID'],
-                ['LEFT JOIN', User::tableName() . ' AS DU', 'U.DEC_ID=DU.ID'],
+                ['LEFT JOIN', BaUser::tableName() . ' AS DU', 'U.DEC_ID=DU.ID'],
             ],
             'page' => $this->page,
             'pageSize' => $this->pageSize,
         ]);
-
-//        foreach ($this->listData['list'] as $key => $value) {
-//            // 后台访问前台的请求参数
-//            if (!$this->isExport && Yii::$app->user->validateAdminAction('user', 'login-to-frontend')) {
-//                $urlParams = BackendToFrontendApi::paramsFormat(['id' => $value['USER_ID']]);
-//                $urlParamStr = '';
-//                foreach ($urlParams as $pKey => $pValue) {
-//                    $urlParamStr .= $pKey . '=' . $pValue . '&';
-//                }
-//                $urlParamStr = substr($urlParamStr, 0, -1);
-//                $this->listData['list'][$key]['BTF_URL'] = $urlParamStr;
-//            } else {
-//                $this->listData['list'][$key]['BTF_URL'] = null;
-//            }
-//        }
     }
 
     /**

+ 0 - 2
common/libs/export/BaseExport.php

@@ -265,11 +265,9 @@ class BaseExport extends Component {
         } else {
             throw new Exception($this->listModelClass.'的getList方法不存在');
         }
-        LoggerTool::info($list);
         if($page >= $list['totalPages']){
             return 'finish';
         }
-        LoggerTool::info($list['list']);
         if(!empty($list['list'])){
             foreach($list['list'] as $columnData){
                 fputcsv($this->_fp, Tool::arrTextConvert($columnData));

+ 1 - 3
common/models/forms/BaApproachDeclarationForm.php

@@ -413,8 +413,6 @@ class BaApproachDeclarationForm extends Model
         $user->PROVINCE = $this->province ?? 0;
         $user->LGA_NAME = $this->lgaName;
         $user->CITY_NAME = $this->cityName;
-//        $user->CITY = $this->city ?? 0;
-//        $user->COUNTY = intval($this->county) ?? 0;
         $user->AVATAR = 'avatar/1.png';
         $user->IS_DEC = 0;
         $user->DEC_ID = $this->_decId ?? '';
@@ -436,7 +434,7 @@ class BaApproachDeclarationForm extends Model
         $userForm->userName = $this->insertUserName;
         $userForm->zcPv = $this->_decPv;
         $userForm->zcAmount = $this->_decAmount;
-        $userForm->conUserName = $this->conUserName;
+        $userForm->conUserName = $this->conUserName ?? '';
         $userForm->recUserName = $this->recUserName;
         $userForm->location = $this->location;
         $userForm->idCard = $this->mobile;

+ 0 - 2
common/models/forms/BaApproachDeclarationLoopForm.php

@@ -157,9 +157,7 @@ class BaApproachDeclarationLoopForm extends Model
                         }else{
                             throw new Exception($goods['GOODS_NAME'].'Sold out');// 商品已下架
                         }
-
                     }
-
                 }
 				
                 if (is_array($value)) {

+ 22 - 77
common/models/forms/BaUserForm.php

@@ -3,20 +3,12 @@ namespace common\models\forms;
 
 use common\components\Model;
 use common\helpers\Date;
-use common\helpers\Form;
-use common\helpers\snowflake\SnowFake;
-use common\helpers\user\Balance;
 use common\helpers\user\Info;
 use common\libs\logging\operate\UserOperate;
 use common\models\BaUser;
 use common\models\BaUserInfo;
-use common\models\Period;
-use common\models\DeclarationLevel;
-use common\models\EmployLevel;
 use common\models\User;
 use common\models\UserInfo;
-use common\models\UserNetwork;
-use common\models\UserRelation;
 use yii\db\Exception;
 
 /**
@@ -55,10 +47,7 @@ class BaUserForm extends Model
     private $_recUid;
     private $_limit = 1000;
 
-//    private $_conTopUid;
     private $_conTopDeep;
-//    private $_recTopUid;
-//    private $_recTopDeep;
 
     public function init() {
         parent::init();
@@ -75,7 +64,7 @@ class BaUserForm extends Model
         return [
             [['userId', 'userName', 'zcPv', 'zcAmount', 'conUserName', 'recUserName','conUid', 'recUid', 'location',/* 'nation', */'realName', /* 'mobile','openBank','bankAddress','bankNo', */ 'email'], 'trim'],
             [['userId', 'userName',/* 'zcPv', 'zcAmount',*/ 'conUid', 'recUid', 'location'], 'required', 'on'=>'addWithUid'],
-            [['userId', 'userName',/* 'zcPv', 'zcAmount', 'conUserName', 'recUserName', 'location'*/], 'required', 'on'=>['addWithUserName', 'addByAdmin']],
+            [['userId', 'userName',/* 'zcPv', 'zcAmount', 'conUserName',*/ 'recUserName', /*'location'*/], 'required', 'on'=>['addWithUserName', 'addByAdmin']],
             [['idCard', 'allData'], 'required', 'on'=>['addWithUserName']],
             [['userName'], 'required', 'on'=>['validateUser', 'noLoginModifyPassword']],
             [['conUid'], 'required', 'on'=>['validateCon', 'validateAddWithUid']],
@@ -84,7 +73,6 @@ class BaUserForm extends Model
             [['recUserName'], 'required', 'on'=>['validateRecName', 'validateAddWithName']],
             [['conUid', 'location'], 'required', 'on'=>['validateLocation', 'validateAddWithUid']],
             [['conUserName', 'location'], 'required', 'on'=>['validateLocationConName', 'validateAddWithName']],
-
             [[/* 'nation' ,*/'realName'/*,  'mobile', */ /*'idCard',*/ /* 'openBank', 'bankAddress', 'bankNo' *//*, 'email'*/], 'required', 'on'=>'modifyProfile'],
             [['oldPassword','verifyPassword'], 'required','on' => ['modifyPassword', 'modifyPasswordPay', 'noLoginModifyPassword']],
             [['password'], 'required','on' => ['modifyPassword', 'noLoginModifyPassword']],
@@ -93,18 +81,12 @@ class BaUserForm extends Model
             ['verifyPassword', 'compare', 'compareAttribute' => 'payPassword' ,'message'=>'The two payment passwords are inconsistent' ,'on' => ['modifyPasswordPay']],//两次支付密码输入不一致
             [['userId'], 'unique', 'targetClass'=>BaUserInfo::class, 'targetAttribute'=>'USER_ID', 'on' => ['addWithUserName', 'addWithUid', 'addByAdmin']],
             [['userName'], 'unique', 'targetClass'=>BaUserInfo::class, 'targetAttribute'=>'USER_NAME' , 'on' => ['addWithUserName', 'addWithUid', 'addByAdmin']],
-//            [['conUid'], 'exist', 'targetClass'=>UserInfo::class, 'targetAttribute'=>'USER_ID', 'on' => ['addWithUserName', 'addWithUid', 'addByAdmin']],
             [['recUid'], 'exist', 'targetClass'=>UserInfo::class, 'targetAttribute'=>'USER_ID', 'on' => ['addWithUserName', 'addWithUid', 'addByAdmin']],
-//            [['conUid'], 'isConUid', 'on' => ['addWithUserName', 'addWithUid', 'addByAdmin']],
-//            [['recUid'], 'isRecUid', 'on' => ['addWithUserName', 'addWithUid', 'addByAdmin']],
-//            [['conUserName'], 'exist', 'targetClass'=>UserInfo::class, 'targetAttribute'=>'USER_NAME', 'on' => ['addWithUserName', 'addWithUid', 'addByAdmin']],
+            [['recUid'], 'isRecUid', 'on' => ['addWithUserName', 'addWithUid', 'addByAdmin']],
+            [['conUserName'], 'exist', 'targetClass'=>UserInfo::class, 'targetAttribute'=>'USER_NAME', 'on' => ['addWithUserName', 'addWithUid', 'addByAdmin']],
             [['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']],
-            //[['idCard'], 'isSameNetwork'],
             [[/*'zcPv',*/ 'zcAmount'], 'price', 'on' => ['addWithUserName', 'addWithUid', 'addByAdmin']],
-//            [['zcPv'], 'isMinDecLevel', 'on' => ['addWithUserName', 'addWithUid', 'addByAdmin']],
         ];
     }
 
@@ -112,16 +94,7 @@ class BaUserForm extends Model
     {
         return [
             'userId' => '会员ID',
-            'conUserName' => '接点人账号',
-            'recUserName' => '开拓人帐号1',
-//            'location' => '区位',
-//            'nation' => '民族',
-            //'realName' => '真实姓名',
-//            'idCard' => '身份证号',
-            //'mobile' => '手机号',
-            // 'openBank' => '银行名称',
-            // 'bankAddress' => '开户支行',
-            // 'bankNo' => '银行账号',
+            'recUserName' => '开拓人帐号',
             'verifyPassword' => 'Confirm password',//确认密码
             'oldPassword' => 'Original password',//原密码
             'password' => 'Login password',//登录密码
@@ -130,6 +103,15 @@ class BaUserForm extends Model
         ];
     }
 
+    /**
+     * 推荐人是否可用
+     * @param $attribute
+     * @param $params
+     */
+    public function isRecUid($attribute, $params) {
+        $this->_recUid = $this->recUid;
+    }
+
     /**
      * 推荐人是否可用
      * @param $attribute
@@ -145,70 +127,36 @@ class BaUserForm extends Model
         }
     }
 
-
     /**
      * 添加会员
-     * @return UserInfo|null
-     * @throws Exception
      */
-    public function add(){
+    public function add()
+    {
         if(!$this->validate()){
             return null;
         }
+
         $insertUid = $this->userId;
         $insertUserName = $this->userName;
-//        $zcPv = $this->zcPv;
-//        $conUid = $this->_conUid;
         $recUid = $this->_recUid;
-//        $location = $this->location;
 
-//        $db = \Yii::$app->db;
-//        $transaction = $db->beginTransaction();
-        try{
-//            $periodObj = Period::instance();
-//            $nowPeriodNum = $periodObj->getNowPeriodNum();
-            // 查找接点人的体系信息
-//            $conUserInfo = UserInfo::find()->where('USER_ID=:USER_ID', [':USER_ID'=>$conUid])->asArray()->one();
+        try {
             // 加入会员信息
             $userInfoModel = new BaUserInfo();
             $userInfoModel->USER_ID = $insertUid;
             $userInfoModel->USER_NAME = $insertUserName;
-//            $userInfoModel->ZC_PV = $zcPv;
             $userInfoModel->ZC_AMOUNT = $this->zcAmount;
             $userInfoModel->CON_UID = '';
-            $userInfoModel->REC_UID = '';
-//            $userInfoModel->SYSTEM_ID = $conUserInfo['SYSTEM_ID'];
-            //$userInfoModel->PERIOD_NUM = $nowPeriodNum;
+            $userInfoModel->REC_UID = $recUid;
             $userInfoModel->CREATED_AT = Date::nowTime();
-//            $userInfoModel->HIGHEST_EMP_LV = EmployLevel::getDefaultLevelId();
             $userInfoModel->ALLOW_TRANSFER = 1;
-//            $userInfoModel->HIGHEST_EMP_LV_PERIOD = $nowPeriodNum;
             $userInfoModel->TRANSFER_PROP = 100.00;
             $userInfoModel->IS_GROUP_LEADER = 0;
             $userInfoModel->GROUP_LEADER_AT = 0;
+            $userInfoModel->save();
 
-            try {
-                $q = $userInfoModel->save();
-            }catch (Exception $e) {
-                throw new Exception($e->getMessage());
-            }
-//            print_r($userInfoModel);exit;
-//            if(!$userInfoModel->save()){
-//                throw new Exception('会员信息更新失败');
-//            }
-//            exit;
-
-            // 清空安置网络和开拓网络的顶点和顶点深度的数值
-//            $this->_conTopUid = null;
-//            $this->_conTopDeep = null;
-//            $this->_recTopUid = null;
-//            $this->_recTopDeep = null;
-
-//            $transaction->commit();
             return $userInfoModel;
-        } catch (Exception $e){
-            throw new Exception($e->getMessage());
-//            $transaction->rollBack();
+        } catch (Exception $e) {
             $this->addError('userId', $e->getMessage());
             return null;
         }
@@ -216,7 +164,6 @@ class BaUserForm extends Model
 
     /**
      * 修改个人资料
-     * @return User|null
      */
     public function modifyProfile(){
         if(!$this->validate()){
@@ -226,10 +173,6 @@ class BaUserForm extends Model
 
         $uid = \Yii::$app->user->id;
         $model = BaUser::findOne(['ID'=>$uid]);
-        // $model->NATION = $this->nation;
-        // $model->OPEN_BANK = $this->openBank;
-        // $model->BANK_NO = $this->bankNo;
-        // $model->BANK_ADDRESS = $this->bankAddress;
         $model->EMAIL = $this->email;
         if(!$model->save()){
             $this->addErrors($model->getErrors());
@@ -246,6 +189,7 @@ class BaUserForm extends Model
 
         return $model;
     }
+
     /**
      * 修改密码
      */
@@ -266,6 +210,7 @@ class BaUserForm extends Model
         }
         return true;
     }
+
     /**
      * 修改支付密码
      */