|
|
|
@@ -4,7 +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, :priority_id, :sort_by, :sort_direction, :current_user |
|
|
|
attr_reader :pm_project_id, :pm_sprint_id, :root_id, :pm_issue_type, :status_ids, :ids, :exclude_ids, :pm_issue_types |
|
|
|
attr_reader :pm_project_id, :pm_project_ids, :pm_sprint_id, :root_id, :pm_issue_type, :status_ids, :ids, :exclude_ids, :pm_issue_types |
|
|
|
attr_accessor :queried_issues, :total_issues_count, :closed_issues_count, :opened_issues_count, :complete_issues_count |
|
|
|
|
|
|
|
validates :category, inclusion: { in: %w[all opened closed], message: '请输入正确的Category'} |
|
|
|
@@ -29,6 +29,7 @@ class Api::V1::Issues::ListService < ApplicationService |
|
|
|
@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_project_ids = params[:pm_project_ids] |
|
|
|
@pm_sprint_id = params[:pm_sprint_id] |
|
|
|
@root_id = params[:root_id] |
|
|
|
@pm_issue_type = params[:pm_issue_type] |
|
|
|
@@ -95,6 +96,7 @@ class Api::V1::Issues::ListService < ApplicationService |
|
|
|
|
|
|
|
# pm_project_id |
|
|
|
issues = issues.where(pm_project_id: pm_project_id) if pm_project_id.present? |
|
|
|
issues = issues.where(pm_project_id: pm_project_ids.to_s.split(",")) if pm_project_ids.present? |
|
|
|
|
|
|
|
# pm_sprint_id |
|
|
|
issues = issues.where(pm_sprint_id: pm_sprint_id) if pm_sprint_id.present? |
|
|
|
|