|
|
@@ -130,8 +130,7 @@ public class ContentRecommendService {
|
|
|
if (childId != null) {
|
|
|
List<ArticleReadingRecord> records = articleReadingRecordMapper.selectList(
|
|
|
new LambdaQueryWrapper<ArticleReadingRecord>()
|
|
|
- .eq(ArticleReadingRecord::getChildId, childId)
|
|
|
- .select("DISTINCT article_id"));
|
|
|
+ .eq(ArticleReadingRecord::getChildId, childId));
|
|
|
for (ArticleReadingRecord r : records) {
|
|
|
if (r.getArticleId() != null) readArticleIds.add(r.getArticleId());
|
|
|
}
|
|
|
@@ -191,8 +190,7 @@ public class ContentRecommendService {
|
|
|
List<Task> existingTasks = taskMapper.selectList(
|
|
|
new LambdaQueryWrapper<Task>()
|
|
|
.eq(Task::getChildId, childId)
|
|
|
- .in(Task::getStatus, "pending", "completed")
|
|
|
- .select("id", "source_type", "source_id"));
|
|
|
+ .in(Task::getStatus, "pending", "completed"));
|
|
|
for (Task t : existingTasks) {
|
|
|
if ("article".equals(t.getSourceType()) && t.getSourceId() != null) {
|
|
|
articleSourceIds.add(t.getSourceId());
|
|
|
@@ -476,7 +474,7 @@ public class ContentRecommendService {
|
|
|
} else {
|
|
|
return ids;
|
|
|
}
|
|
|
- List<ProductOrder> orders = productOrderMapper.selectList(wrapper.select("distinct product_id"));
|
|
|
+ List<ProductOrder> orders = productOrderMapper.selectList(wrapper);
|
|
|
for (ProductOrder o : orders) {
|
|
|
ids.add(o.getProductId());
|
|
|
}
|
|
|
@@ -496,8 +494,7 @@ public class ContentRecommendService {
|
|
|
if (!memberUserIds.isEmpty()) {
|
|
|
List<ActivityRegistration> regs = activityRegistrationMapper.selectList(
|
|
|
new LambdaQueryWrapper<ActivityRegistration>()
|
|
|
- .in(ActivityRegistration::getUserId, memberUserIds)
|
|
|
- .select("distinct activity_id"));
|
|
|
+ .in(ActivityRegistration::getUserId, memberUserIds));
|
|
|
for (ActivityRegistration r : regs) {
|
|
|
ids.add(r.getActivityId());
|
|
|
}
|
|
|
@@ -505,8 +502,7 @@ public class ContentRecommendService {
|
|
|
} else if (userId != null) {
|
|
|
List<ActivityRegistration> regs = activityRegistrationMapper.selectList(
|
|
|
new LambdaQueryWrapper<ActivityRegistration>()
|
|
|
- .eq(ActivityRegistration::getUserId, userId)
|
|
|
- .select("distinct activity_id"));
|
|
|
+ .eq(ActivityRegistration::getUserId, userId));
|
|
|
for (ActivityRegistration r : regs) {
|
|
|
ids.add(r.getActivityId());
|
|
|
}
|