err:=s.db.Where("user_id=? AND tweet_id=? AND comment_id=?",userId,tweetId,commentId).Take(commentThumbs).Error
err:=s.db.Where("user_id=? AND tweet_id=? AND comment_id=? AND comment_type=0",userId,tweetId,commentId).Take(commentThumbs).Error
iferr==nil{
iferr==nil{
switch{
switch{
casecommentThumbs.IsThumbsDown==types.Yes:
casecommentThumbs.IsThumbsDown==types.Yes:
@ -284,7 +284,7 @@ func (s *commentManageServant) ThumbsUpReply(userId int64, tweetId, commentId, r
)
)
commentThumbs:=&dbr.TweetCommentThumbs{}
commentThumbs:=&dbr.TweetCommentThumbs{}
// 检查thumbs状态
// 检查thumbs状态
err:=s.db.Where("user_id=? AND tweet_id=? AND comment_id=? AND reply_id=?",userId,tweetId,commentId,replyId).Take(commentThumbs).Error
err:=s.db.Where("user_id=? AND tweet_id=? AND comment_id=? AND reply_id=? AND comment_type=1",userId,tweetId,commentId,replyId).Take(commentThumbs).Error
err:=s.db.Where("user_id=? AND tweet_id=? AND comment_id=? AND reply_id=?",userId,tweetId,commentId,replyId).Take(commentThumbs).Error
err:=s.db.Where("user_id=? AND tweet_id=? AND comment_id=? AND reply_id=? AND comment_type=1",userId,tweetId,commentId,replyId).Take(commentThumbs).Error