_ShipIndexA_UserInfo=`SELECT * FROM @user WHERE username=?`
_SimpleIndexA_UserInfo=`SELECT * FROM @user WHERE username=?`
_TopicA_DecrTagsById=`UPDATE @tag SET quote_num=quote_num-1, modified_on=? WHERE id IN (?)`
_TopicA_ExistTopicUser=`SELECT 1 FROM @topic_user WHERE user_id=? AND topic_id=? AND is_del=0`
_TopicA_FollowTags=`SELECT t.id id, t.user_id user_id, t.tag tag, t.quote_num quote_num, u.id "u.id", 1 as is_following, c.is_top, u.nickname "u.nickname", u.username "u.username", u.status "u.status", u.avatar "u.avatar", u.is_admin "u.is_admin" FROM @topic_user c JOIN @user u ON c.user_id = u.id JOIN @tag t ON c.topic_id = t.id WHERE c.is_del = 0 AND t.quote_num > 0 AND AND c.user_id=? ORDER BY t.quote_num DESC LIMIT ? OFFSET ?`
_TopicA_FollowTags=`SELECT t.id id, t.user_id user_id, t.tag tag, t.quote_num quote_num, u.id "u.id", 1 as is_following, c.is_top, u.nickname "u.nickname", u.username "u.username", u.status "u.status", u.avatar "u.avatar", u.is_admin "u.is_admin" FROM @topic_user c JOIN @user u ON c.user_id = u.id JOIN @tag t ON c.topic_id = t.id WHERE c.is_del = 0 AND t.quote_num > 0 AND c.user_id=? ORDER BY t.quote_num DESC LIMIT ? OFFSET ?`
_TopicA_FollowTopic=`INSERT INTO @topic_user(user_id, topic_id, created_on) VALUES (?, ?, ?)`
_TopicA_HotTags=`SELECT t.id id, t.user_id user_id, t.tag tag, t.quote_num quote_num, u.id "u.id", u.nickname "u.nickname", u.username "u.username", u.status "u.status", u.avatar "u.avatar", u.is_admin "u.is_admin" FROM @tag t JOIN @user u ON t.user_id = u.id WHERE t.is_del = 0 AND t.quote_num > 0 ORDER BY t.quote_num DESC LIMIT ? OFFSET ?`
_TopicA_IncrTagsById=`UPDATE @tag SET quote_num=quote_num+1, is_del=0, modified_on=? WHERE id IN (?)`
_AuthorizationManage_BeFriendIds=`SELECT user_id FROM @contact WHERE friend_id=? AND status=2 AND is_del=0`
_AuthorizationManage_IsFriend=`SELECT status FROM @contact WHERE user_id=? AND friend_id=? AND is_del=0`
@ -19,9 +24,10 @@ const (
_Comment_GetCommentContentsByIds=`SELECT * FROM @comment_content WHERE comment_id IN (?)`
_Comment_GetCommentCount=`SELECT count(*) FROM @comment WHERE post_id=:post_id AND is_del=0`
_Comment_GetCommentReplyById=`SELECT * FROM @comment_reply WHERE id=? AND is_del=0`
_Comment_GetCommentThumbs=`SELECT * FROM @tweet_comment_thumbs WHERE user_id=? AND tweet_id=?`
_Comment_GetComments=`SELECT * FROM @comment WHERE post_id=? AND is_del=0 ORDER BY %order% LIMIT ? OFFSET ?`
_Comment_GetCommentThumbs=`SELECT user_id, tweet_id, comment_id, reply_id, comment_type, is_thumbs_up, is_thumbs_down FROM @tweet_comment_thumbs WHERE user_id=? AND tweet_id=?`
_Comment_GetCommmentRepliesByIds=`SELECT * FROM @comment_reply WHERE comment_id IN (?) ORDER BY id ASC`
_Comment_GetDefaultComments=`SELECT * FROM @comment WHERE post_id=? AND is_del=0 ORDER BY id ASC LIMIT ? OFFSET ?`
_Comment_GetNewestComments=`SELECT * FROM @comment WHERE post_id=? AND is_del=0 ORDER BY id DESC LIMIT ? OFFSET ?`
_Comment_GetUsersByIds=`SELECT id, nickname, username, status, avatar, is_admin FROM @user WHERE id IN (?)`
_ContactManager_GetContacts=`SELECT id, user_id, friend_id, group_id, remark, status, is_top, is_black, notice_enable, is_del FROM @contact WHERE (user_id=? AND friend_id=?) OR (user_id=? AND friend_id=?)`
_ContactManager_GetUserFriend=`SELECT id, user_id, friend_id, group_id, remark, status, is_top, is_black, notice_enable, is_del FROM @contact WHERE user_id=? AND friend_id=? AND is_del=0`
_ContactManager_IsFriend=`SELECT true FROM @contact WHERE user_id=? AND friend_id=? AND is_del=0 AND status=2`
_ContactManager_ListFriend=`SELECT c.friend_id user_id, u.username username, u.nickname nickname, u.avatar avatar, u.phone phone FROM @contact c JOIN @user u ON c.friend_id=u.id WHERE user_id=? AND status=2 AND is_del=0 ORDER BY u.nickname ASC LIMIT ? OFFSET ?`
_ContactManager_ListFriend=`SELECT c.friend_id user_id, u.username username, u.nickname nickname, u.avatar avatar, u.phone phone FROM @contact c JOIN @user u ON c.friend_id=u.id WHERE c.user_id=? AND c.status=2 AND c.is_del=0 ORDER BY u.nickname ASC LIMIT ? OFFSET ?`
_ContactManager_RejectFriendMsgsUpdate=`UPDATE @message SET reply_id=?, modified_on=? WHERE sender_user_id = ? AND receiver_user_id = ? AND type = ? AND reply_id = ?`
_ContactManager_TotalFriendsById=`SELECT count(*) FROM @contact WHERE user_id=? AND status=2 AND is_del=0`
_FollowingManager_CountFollowings=`SELECT count(*) FROM @following WHERE follow_id=? AND is_del=0`
@ -53,25 +59,25 @@ const (
_FollowingManager_CreateFollowing=`INSERT INTO @following (user_id, follow_id, created_on) VALUES (?, ?, ?)`
_FollowingManager_DeleteFollowing=`UPDATE @following SET is_del=0, deleted_on=? WHERE user_id=? AND follow_id=? AND is_del=0`
_FollowingManager_ExistFollowing=`SELECT 1 FROM @following WHERE user_id=? AND follow_id=? AND is_del=0`
_FollowingManager_ListFollowings=`SELECT u.user_id user_id, u.username username, u.nickname nickname, u.avatar avatar, u.created_on created_on FROM @following f JOIN @user u ON f.user_id=u.id WHERE f.follow_id=? AND f.is_del=0 ORDER BY u.nickname ASC LIMIT ? OFFSET ?`
_FollowingManager_ListFollows=`SELECT u.user_id user_id, u.username username, u.nickname nickname, u.avatar avatar, u.created_on created_on FROM @following f JOIN @user u ON f.follow_id=u.id WHERE f.user_id=? AND f.is_del=0 ORDER BY u.nickname ASC LIMIT ? OFFSET ?`
_FollowingManager_ListFollowings=`SELECT u.id user_id, u.username username, u.nickname nickname, u.avatar avatar, u.created_on created_on FROM @following f JOIN @user u ON f.user_id=u.id WHERE f.follow_id=? AND f.is_del=0 ORDER BY u.nickname ASC LIMIT ? OFFSET ?`
_FollowingManager_ListFollows=`SELECT u.id user_id, u.username username, u.nickname nickname, u.avatar avatar, u.created_on created_on FROM @following f JOIN @user u ON f.follow_id=u.id WHERE f.user_id=? AND f.is_del=0 ORDER BY u.nickname ASC LIMIT ? OFFSET ?`
_Security_GetLatestPhoneCaptcha=`SELECT * FROM @captcha WHERE phone=? AND is_del=0`
_Security_UsePhoneCaptcha=`UPDATE @captcha SET use_times=use_times+1, modified_on=? WHERE id=? AND is_del=0`
_ShipIndex_IndexByAdmin=`SELECT * FROM @p_post WHERE is_del=0 ORDER BY is_top DESC, latest_replied_on DESC LIMIT ? OFFSET ?`
_ShipIndex_IndexByGuest=`SELECT * FROM @p_post WHERE visibility=0 AND is_del=0 ORDER BY is_top DESC, latest_replied_on DESC LIMIT ? OFFSET ?`
_ShipIndex_IndexBySelf=`SELECT * FROM @p_post WHERE is_del=0 AND (visibility=0 OR (visibility=1 AND user_id=?) OR (visibility=2 AND user_id IN ?)) ORDER BY is_top DESC, latest_replied_on DESC LIMIT ? OFFSET ?`
_ShipIndex_IndexCountByAdmin=`SELECT count(*) FROM @p_post WHERE is_del=0`
_ShipIndex_IndexCountByGuest=`SELECT count(*) FROM @p_post WHERE visibility=0 AND is_del=0`
_ShipIndex_IndexCountBySelf=`SELECT count(*) FROM @p_post WHERE is_del=0 AND (visibility=0 OR (visibility=1 AND user_id=?) OR (visibility=2 AND user_id IN ?))`
_SimpleIndex_Index=`SELECT * FROM @p_post WHERE visibility=0 ORDER BY is_top DESC, latest_replied_on DESC LIMIT ? OFFSET ?`
_SimpleIndex_IndexCount=`SELECT count(*) FROM @p_post WHERE visibility=0`
_ShipIndex_IndexByAdmin=`SELECT * FROM @post WHERE is_del=0 ORDER BY is_top DESC, latest_replied_on DESC LIMIT ? OFFSET ?`
_ShipIndex_IndexByGuest=`SELECT * FROM @post WHERE visibility=0 AND is_del=0 ORDER BY is_top DESC, latest_replied_on DESC LIMIT ? OFFSET ?`
_ShipIndex_IndexBySelf=`SELECT * FROM @post WHERE is_del=0 AND (visibility=0 OR (visibility=1 AND user_id=?) OR (visibility=2 AND user_id IN ?)) ORDER BY is_top DESC, latest_replied_on DESC LIMIT ? OFFSET ?`
_ShipIndex_IndexCountByAdmin=`SELECT count(*) FROM @post WHERE is_del=0`
_ShipIndex_IndexCountByGuest=`SELECT count(*) FROM @post WHERE visibility=0 AND is_del=0`
_ShipIndex_IndexCountBySelf=`SELECT count(*) FROM @post WHERE is_del=0 AND (visibility=0 OR (visibility=1 AND user_id=?) OR (visibility=2 AND user_id IN ?))`
_SimpleIndex_Index=`SELECT * FROM @post WHERE visibility=0 ORDER BY is_top DESC, latest_replied_on DESC LIMIT ? OFFSET ?`
_SimpleIndex_IndexCount=`SELECT count(*) FROM @post WHERE visibility=0`
_Tweet_GetAnyPostCount=`SELECT count(*) FROM @post WHERE visibility IN (?)`
_Tweet_GetAnyPosts=`SELECT * FROM @post WHERE visibility IN (?) AND is_del=0 LIMIT ? OFFSET ?`
_Tweet_GetPostAttachmentBill=`SELECT * FROM @post_attachment_bill WHERE post_id=? AND user_id=? AND is_del=0`
@ -85,11 +91,11 @@ const (
_Tweet_GetUserPostStar=`SELECT s.*, P.ID "post.id", P.user_id "post.user_id", P.comment_count "post.comment_count", P.collection_count "post.collection_count", P.upvote_count "post.upvote_count", P.share_count "post.share_count", P.visibility "post.visibility", P.is_top "post.is_top", P.is_essence "post.is_essence", P.is_lock "post.is_lock", P.latest_replied_on "post.latest_replied_on", P.tags "post.tags", P.attachment_price "post.attachment_price", P.ip "post.ip", P.ip_loc "post.ip_loc", P.is_del "post.is_del", P.created_on "post.created_on", P.modified_on "post.modified_on", P.deleted_on "post.deleted_on" FROM @post_star s JOIN @post P ON s.post_id = P.ID WHERE s.post_id = ? AND s.user_id = ? AND s.is_del = 0 AND ( visibility <> 1 OR ( visibility = 1 AND P.user_id = ? ) ) ORDER BY P.ID DESC`
_Tweet_GetUserPostStarCount=`SELECT count(*) FROM @post_star s JOIN @post P ON s.post_id = P.ID WHERE s.user_id = ? AND s.is_del = 0 AND ( visibility <> 1 OR ( visibility = 1 AND P.user_id = ? ) )`
_Tweet_GetUserPostStars=`SELECT s.*, P.ID "post.id", P.user_id "post.user_id", P.comment_count "post.comment_count", P.collection_count "post.collection_count", P.upvote_count "post.upvote_count", P.share_count "post.share_count", P.visibility "post.visibility", P.is_top "post.is_top", P.is_essence "post.is_essence", P.is_lock "post.is_lock", P.latest_replied_on "post.latest_replied_on", P.tags "post.tags", P.attachment_price "post.attachment_price", P.ip "post.ip", P.ip_loc "post.ip_loc", P.is_del "post.is_del", P.created_on "post.created_on", P.modified_on "post.modified_on", P.deleted_on "post.deleted_on" FROM @post_star s JOIN @post P ON s.post_id = P.ID WHERE s.user_id = ? AND s.is_del = 0 AND ( visibility <> 1 OR ( visibility = 1 AND P.user_id = ? ) ) ORDER BY s.ID DESC, P.ID DESC LIMIT ? OFFSET ?`
_Tweet_GetUserPosts=`SELECT * FROM @post WHERE user_id=? AND visibility IN (?) ORDER BY latest_replies_on DESC LIMIT ? OFFSET ?`
_Tweet_GetUserPosts=`SELECT * FROM @post WHERE user_id=? AND visibility IN (?) ORDER BY latest_replied_on DESC LIMIT ? OFFSET ?`
_TweetHelp_GetPostContentByIds=`SELECT id, post_id, content, type, sort FROM @post_content WHERE post_id IN (?) AND is_del=0`
_TweetHelp_GetUsersByIds=`SELECT id, username, nickname, status, avatar, is_admin FROM @user WHERE id IN (?) AND is_del=0`
_TweetManage_AddPostStar=`INSERT INTO @post_star (post_id, user_id, created_on) VALUES (?, ?, ?)`
@ -103,31 +109,31 @@ const (
_TweetManage_DelReplyByCommentIds=`UPDATE @comment_reply SET deleted_on=?, is_del=1 WHERE comment_id IN (?) AND is_del=0`
_TweetManage_HighlightPost=`UPDATE @post SET is_essence=1-is_essence WHERE id=? AND is_del=0`
_TweetManage_LockPost=`UPDATE @post SET is_lock=1-is_lock, modified_on=? WHERE id=? AND is_del=0`
_TweetManage_MediaContentByPostId=`SELECT content FROM post_content WHERE post_id=? AND is_del=0 AND type IN (3, 4, 5, 7, 8)`
_TweetManage_MediaContentByPostId=`SELECT content FROM @post_content WHERE post_id=? AND is_del=0 AND type IN (3, 4, 5, 7, 8)`
_TweetManage_PostHighlightStatus=`SELECT user_id, is_essence FROM @post WHERE id=? AND is_del=0`
_TweetManage_StickPost=`UPDATE @post SET is_top=1-is_top, modified_on=? WHERE id=? AND is_del=0`
_TweetManage_UpdatePost=`UPDATE @post SET comment_count=:comment_count, upvote_count=:upvote_count, collection_count=:collection_count, latest_replies_on=:latest_replies_on, modified_on=:modified_on WHERE id=:id AND is_del=0`
_TweetManage_UpdatePost=`UPDATE @post SET comment_count=:comment_count, upvote_count=:upvote_count, collection_count=:collection_count, latest_replied_on=:latest_replied_on, modified_on=:modified_on WHERE id=:id AND is_del=0`
_TweetManage_VisiblePost=`UPDATE @post SET visibility=?, is_top=?, modified_on=? WHERE id=? AND is_del=0`
_Tweet_UserCommentTweetsByFriend=`SELECT * FROM @post_by_comment WHERE is_del=0 AND comment_user_id=? AND (visibility=0 OR visibility=2) ORDER BY latest_replied_on DESC LIMIT ? OFFSET ?`
_Tweet_UserCommentTweetsByGuest=`SELECT * FROM @post_by_comment WHERE is_del=0 AND comment_user_id=? AND visibility=0 ORDER BY latest_replied_on DESC LIMIT ? OFFSET ?`
_Tweet_UserCommentTweetsBySelf=`SELECT * FROM @post_by_comment WHERE is_del=0 AND comment_user_id=? ORDER BY latest_replied_on DESC LIMIT ? OFFSET ?`
_Tweet_UserCommentTweetsByFriend=`SELECT id, user_id, comment_count, collection_count, upvote_count, share_count, visibility, is_top, is_essence, is_lock, latest_replied_on, tags, attachment_price, ip, ip_loc, created_on, modified_on, deleted_on, is_del FROM @post_by_comment WHERE is_del=0 AND comment_user_id=? AND (visibility=0 OR visibility=2) ORDER BY latest_replied_on DESC LIMIT ? OFFSET ?`
_Tweet_UserCommentTweetsByGuest=`SELECT id, user_id, comment_count, collection_count, upvote_count, share_count, visibility, is_top, is_essence, is_lock, latest_replied_on, tags, attachment_price, ip, ip_loc, created_on, modified_on, deleted_on, is_del FROM @post_by_comment WHERE is_del=0 AND comment_user_id=? AND visibility=0 ORDER BY latest_replied_on DESC LIMIT ? OFFSET ?`
_Tweet_UserCommentTweetsBySelf=`SELECT id, user_id, comment_count, collection_count, upvote_count, share_count, visibility, is_top, is_essence, is_lock, latest_replied_on, tags, attachment_price, ip, ip_loc, created_on, modified_on, deleted_on, is_del FROM @post_by_comment WHERE is_del=0 AND comment_user_id=? ORDER BY latest_replied_on DESC LIMIT ? OFFSET ?`
_Tweet_UserCommentTweetsCountByFriend=`SELECT count(*) FROM @post_by_comment WHERE is_del=0 AND comment_user_id=? AND (visibility=0 OR visibility=2)`
_Tweet_UserCommentTweetsCountByGuest=`SELECT count(*) FROM @post_by_comment WHERE is_del=0 AND comment_user_id=? AND visibility=0`
_Tweet_UserCommentTweetsCountBySelf=`SELECT count(*) FROM @post_by_comment WHERE is_del=0 AND comment_user_id=?`
_Tweet_UserMediaTweetsByFriend=`SELECT * FROM @post_by_media WHERE is_del=0 AND user_id=? AND (visibility=0 OR visibility=2) ORDER BY latest_replied_on DESC LIMIT ? OFFSET ?`
_Tweet_UserMediaTweetsByGuest=`SELECT * FROM @post_by_media WHERE is_del=0 AND user_id=? AND visibility=0 ORDER BY latest_replied_on DESC LIMIT ? OFFSET ?`
_Tweet_UserMediaTweetsBySelf=`SELECT * FROM @post_by_media WHERE is_del=0 AND user_id=? ORDER BY latest_replied_on DESC LIMIT ? OFFSET ?`
_Tweet_UserMediaTweetsByFriend=`SELECT id, user_id, comment_count, collection_count, upvote_count, share_count, visibility, is_top, is_essence, is_lock, latest_replied_on, tags, attachment_price, ip, ip_loc, created_on, modified_on, deleted_on, is_del FROM @post_by_media WHERE is_del=0 AND user_id=? AND (visibility=0 OR visibility=2) ORDER BY latest_replied_on DESC LIMIT ? OFFSET ?`
_Tweet_UserMediaTweetsByGuest=`SELECT id, user_id, comment_count, collection_count, upvote_count, share_count, visibility, is_top, is_essence, is_lock, latest_replied_on, tags, attachment_price, ip, ip_loc, created_on, modified_on, deleted_on, is_del FROM @post_by_media WHERE is_del=0 AND user_id=? AND visibility=0 ORDER BY latest_replied_on DESC LIMIT ? OFFSET ?`
_Tweet_UserMediaTweetsBySelf=`SELECT id, user_id, comment_count, collection_count, upvote_count, share_count, visibility, is_top, is_essence, is_lock, latest_replied_on, tags, attachment_price, ip, ip_loc, created_on, modified_on, deleted_on, is_del FROM @post_by_media WHERE is_del=0 AND user_id=? ORDER BY latest_replied_on DESC LIMIT ? OFFSET ?`
_Tweet_UserMediaTweetsCountByFriend=`SELECT count(*) FROM @post_by_media WHERE is_del=0 AND user_id=? AND (visibility=0 OR visibility=2)`
_Tweet_UserMediaTweetsCountByGuest=`SELECT count(*) FROM @post_by_media WHERE is_del=0 AND user_id=? AND visibility=0`
_Tweet_UserMediaTweetsCountBySelf=`SELECT count(*) FROM @post_by_media WHERE is_del=0 AND user_id=?`
_Tweet_UserStarTweetsByAdmin=`SELECT star.*, post.ID "post.id", post.created_on "post.created_on", post.modified_on "post.modified_on", post.deleted_on "post.deleted_on", post.is_del "post.is_del", post.user_id "post.user_id", post.comment_count "post.comment_count", post.collection_count "post.collection_count", post.share_count "post.share_count", post.upvote_count "post.upvote_count", post.visibility "post.visibility", post.is_top "post.is_top", post.is_essence "post.is_essence", post.is_lock "post.is_lock", post.latest_replied_on "post.latest_replied_on", post.tags "post.tags", post.attachment_price "post.attachment_price", post.ip "post.ip", post.ip_loc "post.ip_loc" FROM @post_star star JOIN @post post ON star.post_id = post.ID WHERE star.is_del=0 AND star.user_id=? ORDER BY post.latest_replied_on DESC; LIMIT ? OFFSET ?`
_Tweet_UserStarTweetsByAdmin=`SELECT star.*, post.ID "post.id", post.created_on "post.created_on", post.modified_on "post.modified_on", post.deleted_on "post.deleted_on", post.is_del "post.is_del", post.user_id "post.user_id", post.comment_count "post.comment_count", post.collection_count "post.collection_count", post.share_count "post.share_count", post.upvote_count "post.upvote_count", post.visibility "post.visibility", post.is_top "post.is_top", post.is_essence "post.is_essence", post.is_lock "post.is_lock", post.latest_replied_on "post.latest_replied_on", post.tags "post.tags", post.attachment_price "post.attachment_price", post.ip "post.ip", post.ip_loc "post.ip_loc" FROM @post_star star JOIN @post post ON star.post_id = post.ID WHERE star.is_del=0 AND star.user_id=? ORDER BY post.latest_replied_on DESC LIMIT ? OFFSET ?`
_Tweet_UserStarTweetsByFriend=`SELECT star.*, post.ID "post.id", post.created_on "post.created_on", post.modified_on "post.modified_on", post.deleted_on "post.deleted_on", post.is_del "post.is_del", post.user_id "post.user_id", post.comment_count "post.comment_count", post.collection_count "post.collection_count", post.share_count "post.share_count", post.upvote_count "post.upvote_count", post.visibility "post.visibility", post.is_top "post.is_top", post.is_essence "post.is_essence", post.is_lock "post.is_lock", post.latest_replied_on "post.latest_replied_on", post.tags "post.tags", post.attachment_price "post.attachment_price", post.ip "post.ip", post.ip_loc "post.ip_loc" FROM @post_star star JOIN @post post ON star.post_id = post.ID WHERE star.is_del=0 AND star.user_id=? AND (post.visibility=0 OR post.visibility=2) ORDER BY post.latest_replied_on DESC LIMIT ? OFFSET ?`
_Tweet_UserStarTweetsByGuest=`SELECT star.*, post.ID "post.id", post.created_on "post.created_on", post.modified_on "post.modified_on", post.deleted_on "post.deleted_on", post.is_del "post.is_del", post.user_id "post.user_id", post.comment_count "post.comment_count", post.collection_count "post.collection_count", post.share_count "post.share_count", post.upvote_count "post.upvote_count", post.visibility "post.visibility", post.is_top "post.is_top", post.is_essence "post.is_essence", post.is_lock "post.is_lock", post.latest_replied_on "post.latest_replied_on", post.tags "post.tags", post.attachment_price "post.attachment_price", post.ip "post.ip", post.ip_loc "post.ip_loc" FROM @post_star star JOIN @post post ON star.post_id = post.ID WHERE star.is_del = 0 AND star.user_id =? AND post.visibility = 0 ORDER BY post.latest_replied_on DESC LIMIT ? OFFSET ?`
_Tweet_UserStarTweetsBySelf=`SELECT star.*, post.ID "post.id", post.created_on "post.created_on", post.modified_on "post.modified_on", post.deleted_on "post.deleted_on", post.is_del "post.is_del", post.user_id "post.user_id", post.comment_count "post.comment_count", post.collection_count "post.collection_count", post.share_count "post.share_count", post.upvote_count "post.upvote_count", post.visibility "post.visibility", post.is_top "post.is_top", post.is_essence "post.is_essence", post.is_lock "post.is_lock", post.latest_replied_on "post.latest_replied_on", post.tags "post.tags", post.attachment_price "post.attachment_price", post.ip "post.ip", post.ip_loc "post.ip_loc" FROM @post_star star JOIN @post post ON star.post_id = post.ID WHERE star.is_del=0 AND star.user_id=? AND (post.visibility<>0 (post.visibility=0 AND post.user_id=?)) ORDER BY post.latest_replied_on DESC; LIMIT ? OFFSET ?`
_Tweet_UserStarTweetsBySelf=`SELECT star.*, post.ID "post.id", post.created_on "post.created_on", post.modified_on "post.modified_on", post.deleted_on "post.deleted_on", post.is_del "post.is_del", post.user_id "post.user_id", post.comment_count "post.comment_count", post.collection_count "post.collection_count", post.share_count "post.share_count", post.upvote_count "post.upvote_count", post.visibility "post.visibility", post.is_top "post.is_top", post.is_essence "post.is_essence", post.is_lock "post.is_lock", post.latest_replied_on "post.latest_replied_on", post.tags "post.tags", post.attachment_price "post.attachment_price", post.ip "post.ip", post.ip_loc "post.ip_loc" FROM @post_star star JOIN @post post ON star.post_id = post.ID WHERE star.is_del=0 AND star.user_id=? AND (post.visibility<>0 OR (post.visibility=0 AND post.user_id=?)) ORDER BY post.latest_replied_on DESC LIMIT ? OFFSET ?`
_Tweet_UserStarTweetsCountByAdmin=`SELECT count(*) FROM @post_star star JOIN @post post ON star.post_id = post.ID WHERE star.is_del=0 AND star.user_id=?`
_Tweet_UserStarTweetsCountByFriend=`SELECT count(*) FROM @post_star star JOIN @post post ON star.post_id = post.ID WHERE star.is_del=0 AND star.user_id=? AND (post.visibility=0 OR post.visibility=2)`
_Tweet_UserStarTweetsCountByGuest=`SELECT count(*) FROM @post_star star JOIN @post post ON star.post_id = post.ID WHERE star.is_del=0 AND star.user_id=? AND post.visibility=0`
_Tweet_UserStarTweetsCountBySelf=`SELECT count(*) FROM @post_star star JOIN @post post ON star.post_id = post.ID WHERE star.is_del=0 AND star.user_id=? AND (post.visibility<>0 (post.visibility=0 AND post.user_id=?))`
_Tweet_UserStarTweetsCountBySelf=`SELECT count(*) FROM @post_star star JOIN @post post ON star.post_id = post.ID WHERE star.is_del=0 AND star.user_id=? AND (post.visibility<>0 OR (post.visibility=0 AND post.user_id=?))`