金额处理

This commit is contained in:
wong
2025-12-29 10:59:32 +08:00
parent 879396e91c
commit 88bc7ef3cd

View File

@@ -235,7 +235,7 @@ class ChannelUserController extends Controller
// 2. 财务统计
// 当前可提现金额
$withdrawableAmount = $channel['withdrawableAmount'] ?? 0;
$withdrawableAmount = round(($channel['withdrawableAmount'] ?? 0) / 100, 2); // 分转元
// 已提现金额(已打款的提现申请)
$withdrawnAmount = Db::name('distribution_withdrawal')
@@ -245,7 +245,7 @@ class ChannelUserController extends Controller
['status', '=', DistributionWithdrawal::STATUS_PAID]
])
->sum('amount');
$withdrawnAmount = $withdrawnAmount ?? 0;
$withdrawnAmount = round(($withdrawnAmount ?? 0) / 100, 2); // 分转元
// 待审核金额(待审核的提现申请)
$pendingReviewAmount = Db::name('distribution_withdrawal')
@@ -255,7 +255,7 @@ class ChannelUserController extends Controller
['status', '=', DistributionWithdrawal::STATUS_PENDING]
])
->sum('amount');
$pendingReviewAmount = $pendingReviewAmount ?? 0;
$pendingReviewAmount = round(($pendingReviewAmount ?? 0) / 100, 2); // 分转元
// 总收益(所有收益记录的总和)
$totalRevenue = Db::name('distribution_revenue_record')
@@ -264,7 +264,7 @@ class ChannelUserController extends Controller
['channelId', '=', $channelId]
])
->sum('amount');
$totalRevenue = $totalRevenue ?? 0;
$totalRevenue = round(($totalRevenue ?? 0) / 100, 2); // 分转元
$financialStats = [
'withdrawableAmount' => $withdrawableAmount, // 当前可提现金额