From 96f124423e7dce8eb30566ee247e6bb9c46e71f4 Mon Sep 17 00:00:00 2001 From: Michael Li Date: Wed, 4 Oct 2023 22:02:06 +0800 Subject: [PATCH] sqlx:fixed get follow index tweets incorrect problem --- internal/dao/sakila/auto/cc/cc.go | 2 +- internal/dao/sakila/yesql/yesql_cc.sql | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/dao/sakila/auto/cc/cc.go b/internal/dao/sakila/auto/cc/cc.go index d6e2b25a..016b8ffe 100644 --- a/internal/dao/sakila/auto/cc/cc.go +++ b/internal/dao/sakila/auto/cc/cc.go @@ -110,7 +110,7 @@ const ( _Tweet_GetAnyPostCount = `SELECT count(*) FROM @post WHERE visibility IN (?)` _Tweet_GetAnyPosts = `SELECT * FROM @post WHERE visibility IN (?) AND is_del=0 LIMIT ? OFFSET ?` _Tweet_GetBeFollowIds = `SELECT follow_id FROM @following WHERE user_id=? AND is_del=0` - _Tweet_GetBeFriendIds = `SELECT user_id FROM @contact WHERE friend_id=? AND is_del=0` + _Tweet_GetBeFriendIds = `SELECT user_id FROM @contact WHERE friend_id=? AND status=2 AND is_del=0` _Tweet_GetPostAttachmentBill = `SELECT * FROM @post_attachment_bill WHERE post_id=? AND user_id=? AND is_del=0` _Tweet_GetPostById = `SELECT * FROM @post WHERE id=? AND is_del=0` _Tweet_GetPostContentById = `SELECT * FROM @post_content WHERE id=? AND is_del=0` diff --git a/internal/dao/sakila/yesql/yesql_cc.sql b/internal/dao/sakila/yesql/yesql_cc.sql index d5ae9903..cbeca061 100644 --- a/internal/dao/sakila/yesql/yesql_cc.sql +++ b/internal/dao/sakila/yesql/yesql_cc.sql @@ -1198,7 +1198,7 @@ WHERE user_id=? AND is_del=0; -- name: get_be_friend_ids@tweet -- prepare: stmt -SELECT user_id FROM @contact WHERE friend_id=? AND is_del=0; +SELECT user_id FROM @contact WHERE friend_id=? AND status=2 AND is_del=0; -- name: get_be_follow_ids@tweet -- prepare: stmt