Merge pull request '调整燃烬图的数字类型' (#256) from KingChan/forgeplus:pm_project_develop into pm_project_develop

This commit is contained in:
KingChan 2024-01-25 17:13:16 +08:00
commit 0ce1b5fd9c
1 changed files with 2 additions and 2 deletions

View File

@ -19,12 +19,12 @@ class Api::Pm::SprintIssuesController < Api::Pm::BaseController
data = []
curren_issues = @issues.group(:status_id,:due_date).count
total_count = @issues.count
cardinality = (total_count / time_count).to_f
cardinality = BigDecimal.new(total_count) / BigDecimal.new(time_count)
time_count.times do |x|
e_time = start_time + x
completed = curren_issues[[5,e_time]].to_i + curren_issues[[3, e_time]].to_i - @issues.where(pm_issue_type: 3, status_id: 3).size
total_count = total_count - completed
data << {time: e_time, undone: total_count, completed:completed, base_number: (cardinality * (time_count - x))}
data << {time: e_time, undone: total_count, completed:completed, base_number: (cardinality * (time_count - x)).to_f.round(2)}
end
render_ok(data: data)
end