|
@@ -333,12 +333,17 @@ class PayDetailController extends Curd
|
|
|
try {
|
|
|
$data = $this->insertRechargeInput($request, 'WELFARE');
|
|
|
$data['pay_prepayid'] = $data['join_pay_member_id'] . '-WELFARE';
|
|
|
+ $memberAccount = MemberAccount::where('join_account_member_id', $data['join_pay_member_id'])
|
|
|
+ ->where('member_account_classify', 'WELFARE')
|
|
|
+ ->first();
|
|
|
+ if ($memberAccount->member_account_status != 'ACTIVED'){
|
|
|
+ throw new BusinessException('账户状态异常');
|
|
|
+ }
|
|
|
|
|
|
$this->doInsert($data);
|
|
|
|
|
|
// 金额累加到福利账户
|
|
|
- $memberAccount = MemberAccount::where('join_account_member_id', $data['join_pay_member_id'])->where('member_account_classify', 'WELFARE')->first();
|
|
|
- $memberAccount->member_account_income = $memberAccount->member_account_income + $data['pay_amount'];
|
|
|
+ $memberAccount->member_account_income = $memberAccount->member_account_income + $data['pay_amount'];
|
|
|
$memberAccount->member_account_surplus = $memberAccount->member_account_surplus + $data['pay_amount'];
|
|
|
$memberAccount->save();
|
|
|
|