|
|
|
@@ -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, :sort_by, :sort_direction, :current_user |
|
|
|
attr_reader :pm_project_id, :pm_sprint_id, :parent_id, :pm_issue_type |
|
|
|
attr_reader :pm_project_id, :pm_sprint_id, :root_id, :pm_issue_type |
|
|
|
attr_accessor :queried_issues, :total_issues_count, :closed_issues_count, :opened_issues_count |
|
|
|
|
|
|
|
validates :category, inclusion: {in: %w(all opened closed), message: "请输入正确的Category"} |
|
|
|
@@ -29,7 +29,7 @@ class Api::V1::Issues::ListService < ApplicationService |
|
|
|
@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] |
|
|
|
@parent_id = params[:parent_id] |
|
|
|
@root_id = params[:root_id] |
|
|
|
@pm_issue_type = params[:pm_issue_type] |
|
|
|
@sort_direction = (params[:sort_direction].present? ? params[:sort_direction] : 'desc').downcase |
|
|
|
@current_user = current_user |
|
|
|
@@ -60,7 +60,6 @@ class Api::V1::Issues::ListService < ApplicationService |
|
|
|
when 'atme' # @我的 |
|
|
|
issues = issues.joins(:issue_participants).where(issue_participants: {participant_type: 'atme', participant_id: current_user&.id}) |
|
|
|
end |
|
|
|
|
|
|
|
# author_id |
|
|
|
issues = issues.where(author_id: author_id) if author_id.present? |
|
|
|
|
|
|
|
@@ -71,8 +70,8 @@ class Api::V1::Issues::ListService < ApplicationService |
|
|
|
issues = issues.where(fixed_version_id: milestone_id) if milestone_id.present? |
|
|
|
|
|
|
|
#pm相关 |
|
|
|
# parent_id, |
|
|
|
issues = issues.where(parent_id: parent_id) if parent_id.present? |
|
|
|
# root_id, |
|
|
|
issues = issues.where(root_id: root_id) if root_id.present? |
|
|
|
|
|
|
|
# pm_issue_type |
|
|
|
issues = issues.where(pm_issue_type: pm_issue_type) if pm_issue_type.present? |
|
|
|
|