查询library为null直接返回,修改library排序顺序为asc

This commit is contained in:
litianxiang
2025-10-31 13:50:48 +08:00
parent ba55eefa18
commit 3caf0cd440
2 changed files with 2 additions and 7 deletions

View File

@@ -53,14 +53,9 @@ public class VisitRecordController {
log.info("开始查询顾客ID为{}的进店记录", customerId);
List<LibraryVo> result = visitRecordService.getByCustomerId(customerId);
if (result != null && !result.isEmpty()) {
log.info("查询成功顾客ID为{}的进店记录为:{}", customerId, result);
return ApiResponse.success(result);
} else {
log.warn("没有找到顾客ID为{}的进店记录", customerId);
return ApiResponse.error("No visit records found for customer ID: " + customerId);
}
}
}

View File

@@ -65,7 +65,7 @@ public class VisitRecordServiceImpl extends ServiceImpl<VisitRecordMapper, Visit
LambdaQueryWrapper<TryOnEffect> effectWrapper = new LambdaQueryWrapper<>();
effectWrapper.eq(TryOnEffect::getVisitRecordId, visitRecord.getId())
.eq(TryOnEffect::getIsFavorite, 1)
.orderByDesc(TryOnEffect::getCreatedTime)
.orderByAsc(TryOnEffect::getCreatedTime)
.last("LIMIT 1");
TryOnEffect favoriteEffect = tryOnEffectService.getOne(effectWrapper);