forked from Gitlink/forgeplus
fixed
This commit is contained in:
parent
40955f5a99
commit
f9e7b92386
|
@ -1,4 +1,6 @@
|
||||||
class Api::V1::Organizations::ProjectsController < Api::V1::BaseController
|
class Api::V1::Organizations::ProjectsController < Api::V1::BaseController
|
||||||
|
before_action :load_organization
|
||||||
|
|
||||||
def index
|
def index
|
||||||
public_projects_sql = @organization.projects.where(is_public: true).to_sql
|
public_projects_sql = @organization.projects.where(is_public: true).to_sql
|
||||||
private_projects_sql = @organization.projects
|
private_projects_sql = @organization.projects
|
||||||
|
@ -6,8 +8,9 @@ class Api::V1::Organizations::ProjectsController < Api::V1::BaseController
|
||||||
.joins(team_projects: {team: :team_users})
|
.joins(team_projects: {team: :team_users})
|
||||||
.where(team_users: {user_id: current_user.id}).to_sql
|
.where(team_users: {user_id: current_user.id}).to_sql
|
||||||
@projects = Project.from("( #{ public_projects_sql} UNION #{ private_projects_sql } ) AS projects")
|
@projects = Project.from("( #{ public_projects_sql} UNION #{ private_projects_sql } ) AS projects")
|
||||||
keywords = params[:search].to_s.each_char.select { |c| c.bytes.first < 240 }.join('')\
|
# 表情处理
|
||||||
@projects = @projects.where(is_public: params[:is_public]) if params[:is_public].present?
|
keywords = params[:search].to_s.each_char.select { |c| c.bytes.first < 240 }.join('')
|
||||||
|
@projects = @projects.where(is_public: params[:is_public] if params[:is_public].present?
|
||||||
@projects = @projects.where(id: params[:pm_project_repository_ids].split(',')) if params[:pm_project_repository_ids].present?
|
@projects = @projects.where(id: params[:pm_project_repository_ids].split(',')) if params[:pm_project_repository_ids].present?
|
||||||
@projects = @projects.where.not(id: params[:exclude_ids].to_s.split(",")) if params[:exclude_ids].present?
|
@projects = @projects.where.not(id: params[:exclude_ids].to_s.split(",")) if params[:exclude_ids].present?
|
||||||
@projects = @projects.where(project_type: ['mirror', 'common']).where("gpid is not null") if params[:actived].present?
|
@projects = @projects.where(project_type: ['mirror', 'common']).where("gpid is not null") if params[:actived].present?
|
||||||
|
|
Loading…
Reference in New Issue