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