修复(收益): 纠正累计收益统计口径为真实分成收益,排除dmepa与兑换券释放干扰
这个提交包含在:
@@ -109,9 +109,10 @@ class Dashboard extends Common
|
||||
$todayNetGmv = max(0, round($todayGmv - $todayRefundAmount, 2));
|
||||
$refundRate = $totalGmv > 0 ? round(($totalRefundAmount / $totalGmv) * 100, 2) : 0.00;
|
||||
|
||||
// 现金分成总支出 (status = 1 真实入账)
|
||||
$totalPayout = (float) Reward::where('status', 1)->sum('amount');
|
||||
$todayPayout = (float) Reward::where('status', 1)->whereTime('createtime', 'today')->sum('amount');
|
||||
// 现金分成总支出 (status = 1 真实入账,排除 dmepa 及兑换券)
|
||||
$cashTypes = \addons\shopro\service\partner\PartnerConfig::cashTypes();
|
||||
$totalPayout = (float) Reward::where('status', 1)->whereIn('reward_type', $cashTypes)->sum('amount');
|
||||
$todayPayout = (float) Reward::where('status', 1)->whereIn('reward_type', $cashTypes)->whereTime('createtime', 'today')->sum('amount');
|
||||
|
||||
// 平台有效留存 = 有效净 GMV (扣除退款后) - 真实分成总支出
|
||||
$netRetention = round($netGmv - $totalPayout, 2);
|
||||
|
||||
@@ -78,7 +78,9 @@ class Agent extends Common
|
||||
: ('已暂停' . ($ago !== null ? '(距今 ' . $ago . ' 天)' : ''));
|
||||
}
|
||||
|
||||
$cashTypes = \addons\shopro\service\partner\PartnerConfig::cashTypes();
|
||||
$totalCash = \app\admin\model\shopro\partner\Reward::where('user_id', $id)
|
||||
->whereIn('reward_type', $cashTypes)
|
||||
->where('status', 1)
|
||||
->where('amount', '>', 0)
|
||||
->sum('amount');
|
||||
@@ -88,6 +90,7 @@ class Agent extends Common
|
||||
->where('reward_type', 'push3')
|
||||
->sum('amount');
|
||||
$partnerExclusiveCash = \app\admin\model\shopro\partner\Reward::where('user_id', $id)
|
||||
->whereIn('reward_type', $cashTypes)
|
||||
->where('status', 1)
|
||||
->where('amount', '>', 0)
|
||||
->where('reward_type', '<>', 'push3')
|
||||
|
||||
@@ -144,7 +144,9 @@ class User extends Common
|
||||
|
||||
// 累计现金收益统计(与 IdentityService 严格对齐,兼顾历史分销与收益中心)
|
||||
$agentTotalIncome = floatval($agent->total_income ?? 0);
|
||||
$cashTypes = \addons\shopro\service\partner\PartnerConfig::cashTypes();
|
||||
$totalCash = \app\admin\model\shopro\partner\Reward::where('user_id', $id)
|
||||
->whereIn('reward_type', $cashTypes)
|
||||
->where('status', 1)
|
||||
->where('amount', '>', 0)
|
||||
->sum('amount');
|
||||
@@ -156,6 +158,7 @@ class User extends Common
|
||||
->where('reward_type', 'push3')
|
||||
->sum('amount');
|
||||
$partnerExclusiveCash = \app\admin\model\shopro\partner\Reward::where('user_id', $id)
|
||||
->whereIn('reward_type', $cashTypes)
|
||||
->where('status', 1)
|
||||
->where('amount', '>', 0)
|
||||
->where('reward_type', '<>', 'push3')
|
||||
|
||||
在新工单中引用
屏蔽一个用户