Browse Source

新增:流水记录当前余额

master
weigang 5 years ago
parent
commit
d4d22e57fc
  1. 7
      app/Service/v3/Implementations/FinancialRecordService.php

7
app/Service/v3/Implementations/FinancialRecordService.php

@ -39,6 +39,12 @@ class FinancialRecordService implements FinancialRecordServiceInterface
$financialRecord->suffix($mod);
}
// 获取当前用户的流水前余额
$balance = UserBalance::query()->firstOrNew([
'user_type' => $record['user_type'],
'source_id' => $user_id
])->value('balance');
return $financialRecord->fill(
[
'user_id' => $user_id,
@ -50,6 +56,7 @@ class FinancialRecordService implements FinancialRecordServiceInterface
'desc' => $record['desc'],
'comment' => $record['comment'],
'status' => $record['status'],
'current_balance' => $balance
]
)->save();

Loading…
Cancel
Save