修改搜索显示数量不对的问题

This commit is contained in:
sylor_huang@126.com
2020-04-22 09:19:43 +08:00
parent 611aafdb4f
commit 2b24bc9724
4 changed files with 7 additions and 7 deletions

View File

@@ -15,8 +15,8 @@ class ProjectCategoriesController < ApplicationController
if current_user&.logged?
projects = Project.list_user_projects(current_user.id)
else
projects = Project.no_anomory_projects.visible
projects = Project.visible
end
@category_group_list = projects.joins(:project_category).group("project_categories.id", "project_categories.name").size
@category_group_list = projects.no_anomory_projects.joins(:project_category).group("project_categories.id", "project_categories.name").size
end
end

View File

@@ -51,10 +51,10 @@ class ProjectsController < ApplicationController
if current_user&.logged?
projects = Project.list_user_projects(current_user.id)
else
projects = Project.no_anomory_projects.visible
projects = Project.visible
end
# projects = Project.visible
@project_group_list = projects.group(:project_type).size
@project_group_list = projects.no_anomory_projects.group(:project_type).size
end
def update