Merge branch 'r/paopao-ce-plus' into r/paopao-ce-xtra

r/paopao-ce-xtra
Michael Li 2 years ago
commit 6e4e03cf78
No known key found for this signature in database

@ -35,7 +35,7 @@ const (
_TopicA_TagsForIncr = `SELECT id, user_id, tag, quote_num FROM @tag WHERE tag IN (?)`
_TopicA_TopicInfos = `SELECT topic_id, is_top FROM @topic_user WHERE is_del=0 AND user_id=? AND topic_id IN (?)`
_TopicA_TopicIsTop = `SELECT is_top FROM @topic_user WHERE user_id=? AND topic_id=? AND is_del=0`
_TopicA_UnfollowTopic = `UPDATE @topic_user SET is_del=1, deleted_on=? WHERE user_id=? AND topic_id=? AND is_del=0`
_TopicA_UnfollowTopic = `DELETE FROM @topic_user WHERE user_id=? AND topic_id=? AND is_del=0`
_TweetA_AttachmentByTweetId = `SELECT * FROM @user WHERE username=?`
_TweetA_FavoriteByTweetId = `SELECT * FROM @user WHERE username=?`
_TweetA_ReactionByTweetId = `SELECT * FROM @user WHERE username=?`

@ -139,14 +139,14 @@ func (s *topicSrvA) GetFollowTags(userId int64, limit int, offset int) (res cs.T
func (s *topicSrvA) FollowTopic(userId int64, topicId int64) (err error) {
exist := false
if err = s.q.ExistTopicUser.Get(&exist, userId, topicId); err == nil {
if err = s.q.ExistTopicUser.Get(&exist, userId, topicId); err != nil {
_, err = s.q.FollowTopic.Exec(userId, topicId, time.Now().Unix())
}
return
}
func (s *topicSrvA) UnfollowTopic(userId int64, topicId int64) error {
_, err := s.q.UnfollowTopic.Exec(userId, topicId, time.Now().Unix())
_, err := s.q.UnfollowTopic.Exec(userId, topicId)
return err
}

@ -168,8 +168,7 @@ INSERT INTO @topic_user(user_id, topic_id, created_on) VALUES (?, ?, ?)
-- name: unfollow_topic@topic_a
-- prepare: stmt
UPDATE @topic_user
SET is_del=1, deleted_on=?
DELETE FROM @topic_user
WHERE user_id=? AND topic_id=? AND is_del=0;
-- name: stick_topic@topic_a

Loading…
Cancel
Save