mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-22 12:45:46 +08:00
issue index for pm
This commit is contained in:
@@ -4,6 +4,7 @@ class Api::V1::Issues::ListService < ApplicationService
|
||||
attr_reader :project, :only_name, :category, :participant_category, :keyword, :author_id, :issue_tag_ids
|
||||
attr_reader :begin_date, :end_date
|
||||
attr_reader :milestone_id, :assigner_id, :status_id, :sort_by, :sort_direction, :current_user
|
||||
attr_reader :pm_project_id, :pm_sprint_id
|
||||
attr_accessor :queried_issues, :total_issues_count, :closed_issues_count, :opened_issues_count
|
||||
|
||||
validates :category, inclusion: {in: %w(all opened closed), message: "请输入正确的Category"}
|
||||
@@ -26,6 +27,8 @@ class Api::V1::Issues::ListService < ApplicationService
|
||||
@begin_date = params[:begin_date]
|
||||
@end_date = params[:end_date]
|
||||
@sort_by = params[:sort_by].present? ? params[:sort_by] : 'issues.updated_on'
|
||||
@pm_project_id = params[:pm_project_id]
|
||||
@pm_sprint_id = params[:pm_sprint_id]
|
||||
@sort_direction = (params[:sort_direction].present? ? params[:sort_direction] : 'desc').downcase
|
||||
@current_user = current_user
|
||||
end
|
||||
@@ -65,6 +68,12 @@ class Api::V1::Issues::ListService < ApplicationService
|
||||
# milestone_id
|
||||
issues = issues.where(fixed_version_id: milestone_id) if milestone_id.present?
|
||||
|
||||
# pm_project_id
|
||||
issues = issues.where(pm_project_id: pm_project_id) if pm_project_id.present?
|
||||
|
||||
# pm_sprint_id
|
||||
issues = issues.where(pm_sprint_id: pm_sprint_id) if pm_sprint_id.present?
|
||||
|
||||
# assigner_id
|
||||
issues = issues.joins(:assigners).where(users: {id: assigner_id}) if assigner_id.present?
|
||||
|
||||
|
||||
Reference in New Issue
Block a user