Просмотр исходного кода

Merge branch 'dev' of http://16.162.42.175:8014/guanli/ngds into dev

theojeng 3 лет назад
Родитель
Сommit
1a23a60a56

+ 6 - 4
common/models/forms/ApproachOrderForm.php

@@ -301,7 +301,7 @@ class ApproachOrderForm extends Model
         }
 
         // 订单类型:userOrder(会员订单)、userUpgrade(会员升级)、userDec(会员报单)
-        $orderType = $customFields[1]['value'] ?? false;
+        $orderType = $this->note['metadata']['custom_fields'][1]['value'] ?? false;
 
         $db = \Yii::$app->db;
         $transaction = $db->beginTransaction();
@@ -335,11 +335,13 @@ class ApproachOrderForm extends Model
 
                     // 同步报单
                     DecOrder::insertOne($approachDecOrder);
+
                     // 修改会员锁定状态
-                    if (!User::updateAll(['STATUS' => 1], 'ID=:USER_ID', [':USER_ID' => $approachDecOrder['TO_USER_ID']])) {
-                        throw new Exception(Form::formatErrorsForApi('change user status error'));
+                    if (in_array($orderType, ['userDec', 'baUpgrade'])) {
+                        if (!User::updateAll(['STATUS' => 1], 'ID=:USER_ID', [':USER_ID' => $approachDecOrder['TO_USER_ID']])) {
+                            throw new Exception(Form::formatErrorsForApi('change user status error'));
+                        }
                     }
-
                     // 修改BA会员升级状态
                     if ($orderType === 'baUpgrade') {
                         // 查询BA会员名

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

@@ -406,7 +406,7 @@ class BaApproachDeclarationForm extends Model
         $user->BANK_CITY = $this->bankCity ?? 0;
         $user->BANK_COUNTY = $this->bankCounty ?? 0;
         $user->CREATED_AT = Date::nowTime();
-        $user->STATUS = 1;
+        $user->STATUS = 0;
         $user->DEC_LV = $this->decLv;
         $user->LAST_DEC_LV = $this->decLv;
         $user->EMP_LV = EmployLevel::getDefaultLevelId();

+ 1 - 1
common/models/forms/BaApproachOrderForm.php

@@ -280,7 +280,7 @@ class BaApproachOrderForm extends Model
         }
 
         // 订单类型:baOrder(BA订单)、baDec(BA报单)
-        $orderType = $customFields[1]['value'] ?? false;
+        $orderType = $this->note['metadata']['custom_fields'][1]['value'] ?? false;
 
         $db = \Yii::$app->db;
         $transaction = $db->beginTransaction();

+ 1 - 0
common/models/forms/BaDeclarationForm.php

@@ -5,6 +5,7 @@ use common\components\Model;
 use common\helpers\Cache;
 use common\helpers\Date;
 use common\helpers\Form;
+use common\helpers\LoggerTool;
 use common\helpers\user\Cash;
 use common\helpers\user\Reconsume;
 use common\helpers\user\Info;

+ 0 - 4
common/models/forms/DeclarationForm.php

@@ -732,10 +732,6 @@ class DeclarationForm extends Model
             if(!($decResult = $this->addDecOrder())) {
                 throw new Exception(Form::formatErrorsForApi($decResult->getErrors()));
             }
-            // 修改BA会员升级状态
-            if (!BaUser::updateAll(['WHETHER_UPGRADE' => 1, 'BA_UPGRADE_AT' => time()], 'USER_NAME=:USER_NAME', [':USER_NAME' => $this->insertUserName])) {
-                throw new Exception(Form::formatErrorsForApi('BA升级状态错误'));
-            }
         }
         return true;
     }

+ 9 - 9
common/models/forms/UserForm.php

@@ -83,7 +83,7 @@ class UserForm extends Model
             [['conUid', 'location'], 'required', 'on'=>['validateLocation', 'validateAddWithUid']],
             [['conUserName', 'location'], 'required', 'on'=>['validateLocationConName', 'validateAddWithName']],
 
-            [['nation','realName', 'mobile', /*'idCard',*/ 'openBank', 'bankAddress', 'bankNo'/*, 'email'*/], 'required', 'on'=>'modifyProfile'],
+            [[/*'nation',*/'realName', 'mobile', /*'idCard',*/ /*'openBank', 'bankAddress', 'bankNo'*//*, 'email'*/], 'required', 'on'=>'modifyProfile'],
             [['oldPassword','verifyPassword'], 'required','on' => ['modifyPassword', 'modifyPasswordPay', 'noLoginModifyPassword']],
             [['password'], 'required','on' => ['modifyPassword', 'noLoginModifyPassword']],
             [['payPassword'], 'required','on' => ['modifyPasswordPay']],
@@ -113,13 +113,13 @@ class UserForm extends Model
             'conUserName' => '接点人账号',
             'recUserName' => '开拓人帐号',
             'location' => '区位',
-            'nation' => '民族',
+//            'nation' => '民族',
             //'realName' => '真实姓名',
 //            'idCard' => '身份证号',
             //'mobile' => '手机号',
-            'openBank' => '银行名称',
-            'bankAddress' => '开户支行',
-            'bankNo' => '银行账号',
+//            'openBank' => '银行名称',
+//            'bankAddress' => '开户支行',
+//            'bankNo' => '银行账号',
             'verifyPassword' => 'Confirm password',//确认密码
             'oldPassword' => 'Original password',//原密码
             'password' => 'Login password',//登录密码
@@ -544,13 +544,13 @@ class UserForm extends Model
 
         $uid = \Yii::$app->user->id;
         $model = User::findOne(['ID'=>$uid]);
-        $model->NATION = $this->nation;
+//        $model->NATION = $this->nation;
         //$model->REAL_NAME = $this->realName;
         //$model->MOBILE = $this->mobile;
         //$model->ID_CARD = $this->idCard;
-        $model->OPEN_BANK = $this->openBank;
-        $model->BANK_NO = $this->bankNo;
-        $model->BANK_ADDRESS = $this->bankAddress;
+//        $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());

+ 1 - 1
frontendApi/modules/v1/controllers/ShopController.php

@@ -382,7 +382,7 @@ class ShopController extends BaseController {
             if($value['ORDER_TYPE']=='ZC'){
                 $data['list'][$key]['ORDER_TYPE'] = 'Welcome Pack';
             }else{
-                $data['list'][$key]['ORDER_TYPE'] = in_array($value['PAY_TYPE'], ['cash', 'paystack']) ? 'Repeat Purchase': 'Points';
+                $data['list'][$key]['ORDER_TYPE'] = in_array($value['PAY_TYPE'], ['cash', 'pay_stack']) ? 'Repeat Purchase': 'Points';
             }
             $data['list'][$key]['PAY_AT'] = $value['PAY_AT'] ? Date::convert($value['PAY_AT'],'Y-m-d H:i:s') : '';
             $data['list'][$key]['CREATED_AT'] = $value['CREATED_AT'] ? Date::convert($value['CREATED_AT'],'Y-m-d H:i:s') : '';

+ 1 - 1
frontendEle/src/views/user/dec.vue

@@ -625,7 +625,7 @@ export default {
           _this.PayStackForm.amount = response.ORDER_AMOUNT
           _this.PayStackForm.metadata.custom_fields[0].value = response.SN
           if (_this.form.decType === 'ba') {
-            _this.PayStackForm.metadata.custom_fields[1].value = 'baDec';
+            _this.PayStackForm.metadata.custom_fields[1].value = 'baUpgrade';
           } else {
             _this.PayStackForm.metadata.custom_fields[1].value = 'userDec';
           }