Browse Source

fixed 项目列表条件count增加标签名

pull/346/head
xxq250 1 year ago
parent
commit
04f8bcb1b0
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      app/controllers/projects_controller.rb

+ 1
- 1
app/controllers/projects_controller.rb View File

@@ -43,7 +43,7 @@ class ProjectsController < ApplicationController

category_id = params[:category_id]
@total_count =
if category_id.blank? && params[:search].blank? && params[:topic_id].blank? && params[:topic_name].present?
if category_id.blank? && params[:search].blank? && params[:topic_id].blank? && params[:topic_name].blank?
# 默认查询时count性能问题处理
not_category_count = Project.where(project_category_id: nil).count
ProjectCategory.sum("projects_count") - Project.visible.joins("left join organization_extensions on organization_extensions.organization_id = projects.user_id").where("organization_extensions.visibility =2").count + not_category_count


Loading…
Cancel
Save