|
|
@@ -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会员名
|