feat: 收益全额直入商城余额、存量结转与奖项名称全局规范化对齐
这个提交包含在:
@@ -142,11 +142,14 @@ class User extends Common
|
||||
: ('已暂停领取' . ($ago !== null ? '(距今 ' . $ago . ' 天)' : '(从未下单)'));
|
||||
}
|
||||
|
||||
// 累计现金收益统计
|
||||
// 累计现金收益统计(与 IdentityService 严格对齐,兼顾历史分销与收益中心)
|
||||
$agentTotalIncome = floatval($agent->total_income ?? 0);
|
||||
$totalCash = \app\admin\model\shopro\partner\Reward::where('user_id', $id)
|
||||
->where('status', 1)
|
||||
->where('amount', '>', 0)
|
||||
->sum('amount');
|
||||
$alignedTotalIncome = max($agentTotalIncome, (float) $totalCash);
|
||||
|
||||
$push3Cash = \app\admin\model\shopro\partner\Reward::where('user_id', $id)
|
||||
->where('status', 1)
|
||||
->where('amount', '>', 0)
|
||||
@@ -158,9 +161,12 @@ class User extends Common
|
||||
->where('reward_type', '<>', 'push3')
|
||||
->sum('amount');
|
||||
|
||||
$data['income_total_cash'] = number_format((float) $totalCash, 2, '.', '');
|
||||
$data['income_total_cash'] = number_format($alignedTotalIncome, 2, '.', '');
|
||||
$data['total_income'] = number_format($alignedTotalIncome, 2, '.', '');
|
||||
$data['push3_cash_income'] = number_format((float) $push3Cash, 2, '.', '');
|
||||
$data['partner_exclusive_cash'] = number_format((float) $partnerExclusiveCash, 2, '.', '');
|
||||
$data['money'] = number_format(floatval($user->money ?? 0), 2, '.', '');
|
||||
$data['commission'] = number_format(floatval($user->commission ?? 0), 2, '.', '');
|
||||
|
||||
// 兑换券计划资产统计
|
||||
$voucherTotal = floatval($agent->voucher_total ?? 0);
|
||||
|
||||
在新工单中引用
屏蔽一个用户