|
|
@@ -290,9 +290,7 @@ public class CommonRatingServiceImpl extends ServiceImpl<CommonRatingMapper, Com
|
|
|
activityWrapper.eq(StoreOperationalActivity::getStoreId, businessId)
|
|
|
.eq(StoreOperationalActivity::getActivityType, "COMMENT")
|
|
|
.in(StoreOperationalActivity::getStatus, 5, 8)
|
|
|
- // 使用审核时间和开始时间中较晚的那个作为开始时间进行比较
|
|
|
- // GREATEST() 函数取两个值中的较大者,如果其中一个为 NULL,返回另一个;如果两个都为 NULL,返回 NULL(会被 WHERE 子句排除)
|
|
|
- .apply("GREATEST(audit_time, start_time) <= {0}", now)
|
|
|
+ .le(StoreOperationalActivity::getStartTime, now)
|
|
|
.ge(StoreOperationalActivity::getEndTime, now)
|
|
|
.orderByDesc(StoreOperationalActivity::getId); // 按ID降序,优先处理最新创建的活动
|
|
|
List<StoreOperationalActivity> activities = storeOperationalActivityMapper.selectList(activityWrapper);
|
|
|
@@ -316,9 +314,9 @@ public class CommonRatingServiceImpl extends ServiceImpl<CommonRatingMapper, Com
|
|
|
// 检查参与次数限制(每个活动单独计算)
|
|
|
Integer limit = activity.getParticipationLimit();
|
|
|
if (limit != null && limit > 0) {
|
|
|
- // 只统计活动开始时间之后的好评,活动开始前的评论不计入参与次数
|
|
|
+ // 审核成功之前的评论不计算在参与次数中(只统计审核成功时间在活动审核时间之后的评论)
|
|
|
int passedCount = commonRatingMapper.countPassedGoodRatingsByUserAndStore(
|
|
|
- commonRating.getUserId(), businessId, activity.getStartTime());
|
|
|
+ commonRating.getUserId(), businessId, activity.getAuditTime());
|
|
|
if (passedCount > limit) {
|
|
|
log.info("CommonRatingService 好评送券跳过:超过运营活动参与次数 activityId={}, participation_limit={}, count={}, userId={}, storeId={}, activityStartTime={}",
|
|
|
activity.getId(), limit, passedCount, commonRating.getUserId(), businessId, activity.getStartTime());
|