fix(subscribe): update subscription query to include zero expiration time condition
This commit is contained in:
parent
ead1a9a8a6
commit
ea74e4b7d5
@ -79,7 +79,8 @@ func (m *defaultUserModel) QueryUserSubscribe(ctx context.Context, userId int64,
|
|||||||
if len(status) > 0 {
|
if len(status) > 0 {
|
||||||
conn = conn.Where("`status` IN ?", status)
|
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").
|
Preload("Subscribe").
|
||||||
Find(&list).Error
|
Find(&list).Error
|
||||||
})
|
})
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user