fix(subscribe): update subscription query to include zero expiration time condition

This commit is contained in:
Chang lue Tsen 2025-05-06 11:49:21 +09:00
parent ead1a9a8a6
commit ea74e4b7d5

View File

@ -79,7 +79,8 @@ func (m *defaultUserModel) QueryUserSubscribe(ctx context.Context, userId int64,
if len(status) > 0 {
conn = conn.Where("`status` IN ?", status)
}
return conn.Where("`expire_time` > ? OR `finished_at` >= ?", now, sevenDaysAgo).
// 订阅过期时间大于当前时间或者订阅结束时间大于当前时间
return conn.Where("`expire_time` > ? OR `finished_at` >= ? OR `expire_time` = ?", now, sevenDaysAgo, time.UnixMilli(0)).
Preload("Subscribe").
Find(&list).Error
})