Merge branch 'master' of github.com:r888888888/danbooru
This commit is contained in:
@@ -189,6 +189,16 @@ class PostQueryBuilder
|
||||
has_constraints!
|
||||
end
|
||||
|
||||
if q[:commenter_id]
|
||||
relation = relation.where(:id => Comment.where("creator_id = ?", q[:commenter_id]).select("post_id").uniq)
|
||||
has_constraints!
|
||||
end
|
||||
|
||||
if q[:noter_id]
|
||||
relation = relation.where(:id => Note.where("creator_id = ?", q[:noter_id]).select("post_id").uniq)
|
||||
has_constraints!
|
||||
end
|
||||
|
||||
if q[:parent_id]
|
||||
relation = relation.where("(posts.id = ? or posts.parent_id = ?)", q[:parent_id], q[:parent_id])
|
||||
has_constraints!
|
||||
@@ -235,10 +245,10 @@ class PostQueryBuilder
|
||||
when "favcount_asc"
|
||||
relation = relation.order("posts.fav_count ASC, posts.id DESC")
|
||||
|
||||
when "comment"
|
||||
when "comment", "comm"
|
||||
relation = relation.order("posts.last_commented_at DESC, posts.id DESC").where("posts.last_commented_at is not null")
|
||||
|
||||
when "comment_asc"
|
||||
when "comment_asc", "comm_asc"
|
||||
relation = relation.order("posts.last_commented_at ASC, posts.id DESC").where("posts.last_commented_at is not null")
|
||||
|
||||
when "note"
|
||||
|
||||
Reference in New Issue
Block a user