|
@@ -77,7 +77,7 @@ func GetReplyListByReplyCommentId(replyCommentIds []uint64) (list []*YbComment,
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-// GetSimpleByCommentId 根据评论ID,查询评论
|
|
|
+// GetSimpleByCommentId 根据留言ID,查询留言
|
|
|
func GetSimpleByCommentId(commentId uint64)(item *YbComment, err error) {
|
|
|
err = global.DEFAULT_MYSQL.Model(YbComment{}).
|
|
|
Select("comment_id, user_id, type, enabled").
|
|
@@ -87,3 +87,11 @@ func GetSimpleByCommentId(commentId uint64)(item *YbComment, err error) {
|
|
|
}
|
|
|
return
|
|
|
}
|
|
|
+
|
|
|
+// GetMyLatestComment 获取用户最新的留言
|
|
|
+func GetMyLatestComment(userId uint64) (item *YbComment, err error){
|
|
|
+ err = global.DEFAULT_MYSQL.Model(YbComment{}).
|
|
|
+ Select("comment_id, user_id, type, enabled, is_show_name").
|
|
|
+ Where("user_id = ? and type=1", userId).Order("comment_id desc").First(&item).Error
|
|
|
+ return
|
|
|
+}
|