- fixed remove multi-objects no effects and occurs resource leak error when use Minio as OSS(Object Storage System).[#371](https://github.com/rocboss/paopao-ce/pull/371) [#372](https://github.com/rocboss/paopao-ce/pull/372)
_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 @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_IndexByGuest=`SELECT * FROM @post WHERE visibility=90 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=90 OR (visibility=0 AND user_id=?) OR (visibility=50 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`
_ShipIndex_IndexCountByGuest=`SELECT count(*) FROM @post WHERE visibility=90 AND is_del=0`
_ShipIndex_IndexCountBySelf=`SELECT count(*) FROM @post WHERE is_del=0 AND (visibility=90 OR (visibility=0 AND user_id=?) OR (visibility=50 AND user_id IN (?)))`
_SimpleIndex_Index=`SELECT * FROM @post WHERE visibility=90 ORDER BY is_top DESC, latest_replied_on DESC LIMIT ? OFFSET ?`
_SimpleIndex_IndexCount=`SELECT count(*) FROM @post WHERE visibility=90`
_Tweet_CountFollowingTweets=`SELECT count(*) FROM @post WHERE user_id=? AND is_del=0`
_Tweet_CountFollowingTweetsFollow=`SELECT count(*) FROM @post WHERE (user_id=? OR (visibility>=60 AND user_id IN(?))) AND is_del=0`
_Tweet_CountFollowingTweetsFriend=`SELECT count(*) FROM @post WHERE (user_id=? OR (visibility>=50 AND user_id IN(?))) AND is_del=0`
_Tweet_CountFollowingTweetsFriendFollow=`SELECT count(*) FROM @post WHERE (user_id=? OR (visibility>=50 AND user_id IN(?)) OR (visibility>=60 AND user_id IN(?))) AND is_del=0`
_Tweet_CountIndexHotsTweets=`SELECT count(*) FROM @post post LEFT JOIN @post_metric metric ON post.id=metric.post_id AND metric.is_del=0 WHERE post.visibility>=90 AND post.is_del=0`
_Tweet_CountIndexNewestTweets=`SELECT count(*) FROM @post WHERE visibility>=90 AND is_del=0`
_Tweet_CountSyncSearchTweets=`SELECT count(*) FROM @post WHERE visibility>=50 AND is_del=0`
_Tweet_CountUserTweets=`SELECT count(*) FROM @post WHERE user_id=? AND visibility>=? AND is_essence=? AND is_del=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_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_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`
_Tweet_GetPostContentsByIds=`SELECT * FROM @post_content WHERE post_id IN (?) AND is_del=0`
_Tweet_GetUserPostCollection=`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_collection 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_GetUserPostCollectionCount=`SELECT count(*) FROM @post_collection 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_GetUserPostCollections=`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_collection 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_GetUserPostCollection=`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_collection 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 >= 50 OR ( visibility = 0 AND P.user_id = ? ) ) ORDER BY P.ID DESC`
_Tweet_GetUserPostCollectionCount=`SELECT count(*) FROM @post_collection s JOIN @post P ON s.post_id = P.ID WHERE s.user_id = ? AND s.is_del = 0 AND ( visibility >= 50 OR ( visibility = 0 AND P.user_id = ? ) )`
_Tweet_GetUserPostCollections=`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_collection s JOIN @post P ON s.post_id = P.ID WHERE s.user_id = ? AND s.is_del = 0 AND ( visibility >= 50 OR ( visibility = 0 AND P.user_id = ? ) ) ORDER BY s.ID DESC, P.ID DESC LIMIT ? OFFSET ?`
_Tweet_GetUserPostCount=`SELECT count(*) FROM @post WHERE user_id=? AND visibility IN (?)`
_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_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 >= 50 OR ( visibility = 0 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 >= 50 OR ( visibility = 0 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 >= 50 OR ( visibility = 0 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_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`
_Tweet_ListFollowingTweets=`SELECT * FROM @post WHERE user_id=? AND is_del=0 ORDER BY is_top DESC, latest_replied_on DESC LIMIT ? OFFSET ?`
_Tweet_ListFollowingTweetsFollow=`SELECT * FROM @post WHERE (user_id=? OR (visibility>=60 AND user_id IN(?))) AND is_del=0 ORDER BY is_top DESC, latest_replied_on DESC LIMIT ? OFFSET ?`
_Tweet_ListFollowingTweetsFriend=`SELECT * FROM @post WHERE (user_id=? OR (visibility>=50 AND user_id IN(?))) AND is_del=0 ORDER BY is_top DESC, latest_replied_on DESC LIMIT ? OFFSET ?`
_Tweet_ListFollowingTweetsFriendFollow=`SELECT * FROM @post WHERE (user_id=? OR (visibility>=50 AND user_id IN(?)) OR (visibility>=60 AND user_id IN(?))) AND is_del=0 ORDER BY is_top DESC, latest_replied_on DESC LIMIT ? OFFSET ?`
_Tweet_ListIndexHotsTweets=`SELECT post.* FROM @post post LEFT JOIN @post_metric metric ON post.id=metric.post_id WHERE post.visibility>=90 AND post.is_del=0 ORDER BY post.is_top DESC, metric.rank_score DESC, post.latest_replied_on DESC LIMIT ? OFFSET ?`
_Tweet_ListIndexNewestTweets=`SELECT * FROM @post WHERE visibility>=90 AND is_del=0 ORDER BY is_top DESC, latest_replied_on DESC LIMIT ? OFFSET ?`
_Tweet_ListSyncSearchTweets=`SELECT * FROM @post WHERE visibility>=50 AND is_del=0 LIMIT ? OFFSET ?`
_Tweet_ListUserTweets=`SELECT * FROM @post WHERE user_id=? AND visibility>=? AND is_essence=? AND is_del=0 ORDER BY is_top DESC, latest_replied_on DESC LIMIT ? OFFSET ?`
_TweetManage_AddPostCollection=`INSERT INTO @post_collection (post_id, user_id, created_on) VALUES (?, ?, ?)`
@ -114,26 +132,30 @@ const (
_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_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 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 ?`
_TweetMetrics_AddTweetMetric=`INSERT INTO @post_metric (post_id, created_on) VALUES (?, ?)`
_TweetMetrics_DeleteTweetMetric=`UPDATE @post_metric SET is_del=1, deleted_on=? WHERE post_id=? AND is_del=0`
_TweetMetrics_GetMotivationFactor=`SELECT motivation_factor FROM @post_metric WHERE post_id=? AND is_del=0`
_TweetMetrics_UpdateRankScore=`UPDATE @post_metric SET rank_score=?, modified_on=? WHERE post_id=? AND is_del=0`
_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>=50 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>=90 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_UserCommentTweetsCountByFriend=`SELECT count(*) FROM @post_by_comment WHERE is_del=0 AND comment_user_id=? AND visibility>=50`
_Tweet_UserCommentTweetsCountByGuest=`SELECT count(*) FROM @post_by_comment WHERE is_del=0 AND comment_user_id=? AND visibility>=90`
_Tweet_UserCommentTweetsCountBySelf=`SELECT count(*) FROM @post_by_comment WHERE is_del=0 AND comment_user_id=?`
_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_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>=50 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=90 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_UserMediaTweetsCountByFriend=`SELECT count(*) FROM @post_by_media WHERE is_del=0 AND user_id=? AND visibility>=50`
_Tweet_UserMediaTweetsCountByGuest=`SELECT count(*) FROM @post_by_media WHERE is_del=0 AND user_id=? AND visibility>=90`
_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_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 OR (post.visibility=0 AND post.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>=50 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>=90 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<>90 OR (post.visibility>=90 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 OR (post.visibility=0 AND post.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>=50`
_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>=90`
_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<>90 OR (post.visibility>=90 AND post.user_id=?))`