|
|
@ -273,12 +273,10 @@ impl<'a> PostQueryBuilder<'a> {
|
|
|
|
|
|
|
|
|
|
|
|
if let Some(for_community_id) = self.for_community_id {
|
|
|
|
if let Some(for_community_id) = self.for_community_id {
|
|
|
|
query = query.filter(community_id.eq(for_community_id));
|
|
|
|
query = query.filter(community_id.eq(for_community_id));
|
|
|
|
query = query.then_order_by(stickied.desc());
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if let Some(for_community_name) = self.for_community_name {
|
|
|
|
if let Some(for_community_name) = self.for_community_name {
|
|
|
|
query = query.filter(community_name.eq(for_community_name));
|
|
|
|
query = query.filter(community_name.eq(for_community_name));
|
|
|
|
query = query.then_order_by(stickied.desc());
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if let Some(url_search) = self.url_search {
|
|
|
|
if let Some(url_search) = self.url_search {
|
|
|
@ -292,6 +290,8 @@ impl<'a> PostQueryBuilder<'a> {
|
|
|
|
.or_filter(body.ilike(searcher));
|
|
|
|
.or_filter(body.ilike(searcher));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
query = query.then_order_by(stickied.desc());
|
|
|
|
|
|
|
|
|
|
|
|
query = match self.sort {
|
|
|
|
query = match self.sort {
|
|
|
|
SortType::Active => query
|
|
|
|
SortType::Active => query
|
|
|
|
.then_order_by(hot_rank_active.desc())
|
|
|
|
.then_order_by(hot_rank_active.desc())
|
|
|
|