Merge pull request 'pm issue link index返回结果移除issue本身' (#189) from KingChan/forgeplus:pm_project_develop into pm_project_develop
This commit is contained in:
commit
4bc7b65726
|
@ -21,13 +21,13 @@ class Api::Pm::IssuesController < Api::Pm::BaseController
|
|||
|
||||
def link_index
|
||||
pm_issue_type = params[:pm_issue_type] || [1, 2, 3]
|
||||
not_join_id = @issue.pm_links.pluck(:be_linkable_id)
|
||||
not_join_id << @issue.id
|
||||
object_issues = Issue.includes(:pm_links).where(
|
||||
pm_project_id: params[:pm_project_id],
|
||||
root_id: nil,
|
||||
pm_issue_type: pm_issue_type
|
||||
).where.not(
|
||||
id: @issue.pm_links.pluck(:be_linkable_id)
|
||||
)
|
||||
).where.not(id: not_join_id)
|
||||
@issues = kaminari_paginate(object_issues)
|
||||
render 'api/v1/issues/index'
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue