修复(收益): 纠正累计收益统计口径为真实分成收益,排除dmepa与兑换券释放干扰

这个提交包含在:
chen
2026-09-19 16:37:54 +08:00
父节点 cbac2a69f4
当前提交 bee5288e88
共有 8 个文件被更改,包括 141 次插入 和 4 次删除

查看文件

@@ -402,12 +402,15 @@ class Agent extends Commission
// 2. 团队成员为目标用户贡献的累计收益与本月收益
$monthStart = strtotime(date('Y-m-01 00:00:00'));
$cashTypes = \addons\shopro\service\partner\PartnerConfig::cashTypes();
$teamTotalReward = RewardModel::where('user_id', $targetUserId)
->whereIn('buyer_id', $teamUserIds)
->whereIn('reward_type', $cashTypes)
->where('status', 1)
->sum('amount');
$teamMonthReward = RewardModel::where('user_id', $targetUserId)
->whereIn('buyer_id', $teamUserIds)
->whereIn('reward_type', $cashTypes)
->where('status', 1)
->where('createtime', '>=', $monthStart)
->sum('amount');

查看文件

@@ -85,7 +85,9 @@ class User extends Common
$agent = \addons\shopro\service\partner\IdentityService::findAgent($user->id);
$partner = \addons\shopro\service\partner\IdentityService::attachProfile($agent, null, $user);
if (empty($partner['total_income']) || $partner['total_income'] === '0.00') {
$cashTypes = \addons\shopro\service\partner\PartnerConfig::cashTypes();
$userRewardCash = \app\admin\model\shopro\partner\Reward::where('user_id', $user->id)
->whereIn('reward_type', $cashTypes)
->where('status', 1)
->where('amount', '>', 0)
->sum('amount');