新增:personal_issues
This commit is contained in:
parent
63ff4306d4
commit
fcedae86cb
|
@ -62,5 +62,21 @@ class Api::Pm::WeeklyIssuesController < Api::Pm::BaseController
|
|||
@this_week_all_issues = @this_week_all_issues.order('created_on desc')
|
||||
@this_week_all_issues = kaminari_paginate(@this_week_all_issues)
|
||||
end
|
||||
|
||||
end
|
||||
def personal_issues
|
||||
@enterprise_identifier = params[:enterprise_identifier] || ''
|
||||
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 = @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).distinct
|
||||
@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).distinct
|
||||
@next_week_all_issues = @next_week_all_issues.order('created_on desc')
|
||||
this_week_page = params[:this_week_page] || 1
|
||||
this_week_limit = params[:this_week_limit] || 15
|
||||
@this_week_all_issues = @this_week_all_issues.page(this_week_page).per(this_week_limit)
|
||||
next_week_page = params[:next_week_page] || 1
|
||||
next_week_limit = params[:next_week_limit] || 15
|
||||
@next_week_all_issues = @next_week_all_issues.page(next_week_page).per(next_week_limit)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -6,6 +6,7 @@ defaults format: :json do
|
|||
get :personal
|
||||
get :group
|
||||
get :group_issues
|
||||
get :personal_issues
|
||||
end
|
||||
end
|
||||
resources :dashboards,only: [:index] do
|
||||
|
|
Loading…
Reference in New Issue