修复:去重
This commit is contained in:
parent
66e7959434
commit
c967684b3c
|
@ -5,9 +5,9 @@ class Api::Pm::WeeklyIssuesController < Api::Pm::BaseController
|
||||||
return render_error('请输入正确的用户ID.') if params[:user_id].blank?
|
return render_error('请输入正确的用户ID.') if params[:user_id].blank?
|
||||||
@all_issues = Issue.joins(:issue_participants).where(issue_participants: {participant_id: params[:user_id], participant_type: ['authored', 'assigned']})
|
@all_issues = Issue.joins(:issue_participants).where(issue_participants: {participant_id: params[:user_id], participant_type: ['authored', 'assigned']})
|
||||||
@all_issues = @all_issues.where(enterprise_identifier: @enterprise_identifier, pm_issue_type: [1,2,3])
|
@all_issues = @all_issues.where(enterprise_identifier: @enterprise_identifier, pm_issue_type: [1,2,3])
|
||||||
@this_week_all_issues = @all_issues.where("due_date >= ? and start_date <= ?", Date.today.beginning_of_week.to_s, Date.today.end_of_week.to_s)
|
@this_week_all_issues = @all_issues.where("due_date >= ? and start_date <= ?", Date.today.beginning_of_week.to_s, Date.today.end_of_week.to_s).distinct
|
||||||
@this_week_all_issues = @this_week_all_issues.order('created_on desc')
|
@this_week_all_issues = @this_week_all_issues.order('created_on desc')
|
||||||
@next_week_all_issues = @all_issues.where("due_date >= ? and start_date <=?", (Date.today.beginning_of_week+1.week).to_s, (Date.today.end_of_week+1.week).to_s)
|
@next_week_all_issues = @all_issues.where("due_date >= ? and start_date <=?", (Date.today.beginning_of_week+1.week).to_s, (Date.today.end_of_week+1.week).to_s).distinct
|
||||||
@next_week_all_issues = @next_week_all_issues.order('created_on desc')
|
@next_week_all_issues = @next_week_all_issues.order('created_on desc')
|
||||||
@this_week_requirement_issues = @this_week_all_issues.where(pm_issue_type: 1)
|
@this_week_requirement_issues = @this_week_all_issues.where(pm_issue_type: 1)
|
||||||
@this_week_task_issues = @this_week_all_issues.where(pm_issue_type: 2)
|
@this_week_task_issues = @this_week_all_issues.where(pm_issue_type: 2)
|
||||||
|
|
Loading…
Reference in New Issue