From 85be565adbf97ed33e7fa9dd2c2cbdb39b09943b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=96=8C?= <259278618@qq.com> Date: Fri, 31 Jul 2026 13:38:52 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=95=88=E6=9E=9C=E5=9B=BE=E9=99=90?= =?UTF-8?q?=E9=A2=9D=E6=94=AF=E6=8C=81=20VIP=20=E4=B8=8D=E9=99=90=E4=B8=8E?= =?UTF-8?q?=E5=B9=BF=E5=91=8A=E5=8A=A0=E6=AC=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- styleagent/service/effect_image_service.go | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/styleagent/service/effect_image_service.go b/styleagent/service/effect_image_service.go index b2138be..61bb398 100644 --- a/styleagent/service/effect_image_service.go +++ b/styleagent/service/effect_image_service.go @@ -33,13 +33,16 @@ func (s *effectImageService) run(ctx context.Context, planId, userId int64) { g.Log().Errorf(ctx, "效果图任务: 方案不存在 planId=%d", planId) return } - // 每日免费次数校验 - limit := dailyEffectLimit(ctx) - if limit > 0 { - used, _ := dao.PlanEffectImage.CountByUserToday(ctx, userId) - if used >= limit { - g.Log().Warningf(ctx, "效果图任务: 用户 %d 当日次数已用尽(%d/%d)", userId, used, limit) - return + // 每日限额:VIP 不限;普通用户 = 基础额度 + 广告激励额外次数 + if !dao.UserMember.IsVip(ctx, userId) { + limit := dailyEffectLimit(ctx) + if limit > 0 { + used, _ := dao.PlanEffectImage.CountByUserToday(ctx, userId) + extra, _ := dao.AdRewardLog.CountTodayByType(ctx, userId, consts.AdTypeEffectExtra) + if used >= limit+extra { + g.Log().Warningf(ctx, "效果图任务: 用户 %d 当日次数已用尽(%d/%d)", userId, used, limit+extra) + return + } } }