修改统计SQL

This commit is contained in:
easonzhu 2025-03-06 15:22:21 +08:00
parent 9c174712d5
commit 7b9fa77249

View File

@ -343,7 +343,7 @@ public class AdminVideoInteractionService {
public Integer queryWatchUserCount(Collection<Integer> videoIds) {
QueryWrapper<VideoUserWatchCollect> wrapper = Wrappers.<VideoUserWatchCollect>query()
// 总观看时长使用字段live_seconds,总人数使用字段vod_seconds
.select("video_id, ifnull(count(0), 0) as vod_seconds")
.select("count(0) as vod_seconds")
.in("video_id", videoIds);
VideoUserWatchCollect totalWatch = videoUserWatchCollectMapper.selectOne(wrapper);
return totalWatch == null ? 0 : totalWatch.getVodSeconds();