Browse Source

fixed issues_count统计增加已分配类型,单独汇总,区分状态

pull/347/head
xxq250 2 years ago
parent
commit
08e17454d5
1 changed files with 6 additions and 0 deletions
  1. +6
    -0
      app/controllers/api/pm/projects_controller.rb

+ 6
- 0
app/controllers/api/pm/projects_controller.rb View File

@@ -13,6 +13,12 @@ class Api::Pm::ProjectsController < Api::Pm::BaseController
def issues_count
return tip_exception '参数错误' unless params[:pm_project_id].present?
@issues = Issue.where(pm_project_id: params[:pm_project_id])
case params[:category].to_s
when 'closed'
@issues = @issues.closed
when 'opened'
@issues = @issues.opened
end
@participant_category_count = {}
if params[:participant_category].to_s == "authoredme" or params[:participant_category].to_s == "assignedme"
issues_category = @issues.joins(:issue_participants).where(issue_participants: {participant_type: %w[authored assigned atme], participant_id: current_user&.id})


Loading…
Cancel
Save