fix redis search limit for 10 items
This commit is contained in:
1 parent
4768da3c7a
commit
fb1f08327d
6 files changed
+16
-8
No files matched your search
+2
-1
@@ -12,8 +12,9 @@ class Panel::Announcement::FrontEnd::BulletinsController < OrbitWidgetController
|
||||
if !params[:search_query].blank?
|
||||
search_cond = {:is_checked=>true,:is_hidden=>false}
|
||||
search_cond.merge!({:bulletin_category_id => "#{params[:category_id]}" }) if !params[:category_id].blank?
|
||||
search = Redis::Search.query("Bulletin", params[:search_query], :conditions =>search_cond)
|
||||
search = Redis::Search.query("Bulletin", params[:search_query], :conditions =>search_cond,:limit=>Bulletin.all.count)
|
||||
search_result = search.collect{|t| t["id"]}
|
||||
|
||||
@bulletins = Bulletin.all.can_display.any_in(_id:search_result).page( params[:page_main]).per(10)
|
||||
else
|
||||
date_now = Time.now
|
||||
|
||||
vendor/built_in_modules/announcement/app/views/panel/announcement/front_end/bulletins/index.html.erb
Vendored
+5
-1
@@ -15,7 +15,11 @@
|
||||
<th><%= t('announcement.bulletin.title') %></th>
|
||||
<th><%= t('announcement.bulletin.postdate') %></th>
|
||||
</tr>
|
||||
|
||||
<% if @bulletins.blank? %>
|
||||
<%=render :partial => 'shared/search_not_found' %>
|
||||
<% else %>
|
||||
<%= t("search.result_get",:item_num=>@bulletins.count) %>
|
||||
<% end %>
|
||||
<% @bulletins.each do |post| %>
|
||||
<tr>
|
||||
<td><%= post.bulletin_category.i18n_variable[I18n.locale] rescue nil %></td>
|
||||
|
||||
Vendored
+1
-1
@@ -12,7 +12,7 @@ class Panel::News::FrontEnd::NewsBulletinsController < OrbitWidgetController
|
||||
if !params[:search_query].blank?
|
||||
search_cond = {:is_checked=>true,:is_hidden=>false}
|
||||
search_cond.merge!({:news_bulletin_category_id => "#{params[:category_id]}" }) if !params[:category_id].blank?
|
||||
search = Redis::Search.query("NewsBulletin", params[:search_query], :conditions =>search_cond)
|
||||
search = Redis::Search.query("NewsBulletin", params[:search_query], :conditions =>search_cond,:limit=>NewsBulletin.all.count)
|
||||
search_result = search.collect{|t| t["id"]}
|
||||
@news_bulletins = NewsBulletin.all.can_display.any_in(_id:search_result).page( params[:page_main]).per(10)
|
||||
else
|
||||
|
||||
+5
-4
@@ -7,7 +7,11 @@
|
||||
<% else %>
|
||||
<h1 class="h1"><%= t('news.news') %></h1>
|
||||
<% end %>
|
||||
|
||||
<% if @news_bulletins.blank? %>
|
||||
<%=render :partial => 'shared/search_not_found' %>
|
||||
<% else %>
|
||||
<%= t("search.result_get",:item_num=>@news_bulletins.count) %>
|
||||
<% end %>
|
||||
<table class="table table-bordered">
|
||||
<tbody>
|
||||
<tr>
|
||||
@@ -25,9 +29,6 @@
|
||||
<td><%= display_date(post.postdate) %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<% if @news_bulletins.blank? %>
|
||||
<%=render :partial => 'shared/search_not_found' %>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
Reference in new issue
Block a user