fix bug: msg destruct sql

pull/594/head
wangchuxiao 2 years ago
parent 1e1d871461
commit 541f8f1a64

@ -207,7 +207,7 @@ func (c *ConversationGorm) GetConversationIDsNeedDestruct(
) (conversations []*relation.ConversationModel, err error) {
return conversations, utils.Wrap(
c.db(ctx).
Where("is_msg_destruct = 1 && UNIX_TIMESTAMP(NOW()) > (msg_destruct_time + UNIX_TIMESTAMP(latest_msg_destruct_time)) && msg_destruct_time != 0").
Where("is_msg_destruct = 1 && msg_destruct_time != 0 && (UNIX_TIMESTAMP(NOW()) > (msg_destruct_time + UNIX_TIMESTAMP(latest_msg_destruct_time)) || latest_msg_destruct_time is NULL)").
Find(&conversations).
Error,
"",

Loading…
Cancel
Save