|
@@ -127,7 +127,7 @@ class RechargeController
|
|
|
$memberAccount = MemberAccount::where('join_account_member_id', $payDetail->join_pay_member_id)
|
|
|
->where('member_account_classify', 'CASH')
|
|
|
->first();
|
|
|
- $addedNbr = $goodsAttributeJson['added'] && $goodsAttributeJson['added']['nbr'] ? $goodsAttributeJson['added']['nbr'] : 0;
|
|
|
+ $addedNbr = !empty($goodsAttributeJson['added']) && !empty($goodsAttributeJson['added']['nbr']) ? $goodsAttributeJson['added']['nbr'] : 0;
|
|
|
$payAmount = floatval($payDetail->pay_amount);
|
|
|
$addedAmount = round($payAmount * $addedNbr, 2);
|
|
|
$added = $memberAccount->member_account_added + $addedAmount;
|
|
@@ -139,13 +139,13 @@ class RechargeController
|
|
|
$memberAccount->member_account_income = $income;
|
|
|
$memberAccount->member_account_surplus = $memberAccount->member_account_surplus + $payAmount;
|
|
|
$memberAccount->save();
|
|
|
+ if (!empty($goodsAttributeJson)){
|
|
|
+ // 根据最新的数据,更新用户等级
|
|
|
+ RechargeService::disposeRole($payDetail->join_pay_member_id, $payDetail->pay_amount);
|
|
|
|
|
|
- // 根据最新的数据,更新用户等级
|
|
|
- RechargeService::disposeRole($payDetail->join_pay_member_id, $payDetail->pay_amount);
|
|
|
-
|
|
|
- // 发券
|
|
|
- RechargeService::disposeRoleCoupon($goodsAttributeJson, $couponParams, $payDetail->join_pay_member_id);
|
|
|
-
|
|
|
+ // 发券
|
|
|
+ RechargeService::disposeRoleCoupon($goodsAttributeJson, $couponParams, $payDetail->join_pay_member_id);
|
|
|
+ }
|
|
|
// 计算充值提成
|
|
|
if (!empty($payDetail->join_pay_object_json)) {
|
|
|
$payObjectJson = json_decode($payDetail->join_pay_object_json, true);
|