issue按id集合查询,选择关联issue时排除已选id集合
This commit is contained in:
parent
fea7c52227
commit
1bdb6dad98
|
@ -29,8 +29,6 @@ class Api::Pm::IssuesController < Api::Pm::BaseController
|
|||
@issue.pm_links.pluck(:be_linkable_id)
|
||||
end
|
||||
|
||||
not_join_id = params[:exclude_ids].to_s.split(",") if params[:exclude_ids].present?
|
||||
|
||||
not_join_id << @issue.id
|
||||
object_issues = Issue.where(
|
||||
pm_project_id: params[:pm_project_id],
|
||||
|
|
|
@ -76,9 +76,6 @@ class Api::V1::Issues::ListService < ApplicationService
|
|||
# milestone_id
|
||||
issues = issues.where(fixed_version_id: milestone_id) if milestone_id.present?
|
||||
|
||||
# ids
|
||||
issues = issues.where(id: params[:ids].to_s.split(",")) if params[:ids].present?
|
||||
|
||||
#pm相关
|
||||
# root_id# -1 查一级目录
|
||||
issues = if root_id.to_i == -1
|
||||
|
@ -107,6 +104,12 @@ class Api::V1::Issues::ListService < ApplicationService
|
|||
# status_ids
|
||||
issues = issues.where(status_id: status_ids) unless status_ids.blank?
|
||||
|
||||
# ids
|
||||
issues = issues.where(id: params[:ids].to_s.split(",")) if params[:ids].present?
|
||||
|
||||
# exclude_ids
|
||||
issues = issues.where.not(id: params[:exclude_ids].to_s.split(",")) if params[:exclude_ids].present?
|
||||
|
||||
if begin_date&.present? || end_date&.present?
|
||||
issues = issues.where('issues.created_on between ? and ?', begin_date&.present? ? begin_date.to_time : Time.now.beginning_of_day, end_date&.present? ? end_date.to_time.end_of_day : Time.now.end_of_day)
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue