small fix for charts
This commit is contained in:
parent
05a7c8ee06
commit
04b2af9e20
|
@ -15,20 +15,32 @@ class Admin::RecruitmentsController < OrbitAdminController
|
|||
case params[:type]
|
||||
when "posting"
|
||||
@startdt = DateTime.parse("#{year}/#{month}")
|
||||
enddt = DateTime.parse("#{year}/#{month.to_i + 1}")
|
||||
if month.to_i < 12
|
||||
enddt = DateTime.parse("#{year}/#{month.to_i + 1}")
|
||||
else
|
||||
enddt = DateTime.parse("#{year.to_i + 1}/1")
|
||||
end
|
||||
@data = {}
|
||||
@data[t("recruitment.post_t.type1")] = RecruitmentJob.jobs.where(:created_at.gte => @startdt, :created_at.lt => enddt).count
|
||||
@data[t("recruitment.post_t.type2")] = RecruitmentJob.internships.where(:created_at.gte => @startdt, :created_at.lt => enddt).count
|
||||
@data[t("recruitment.post_t.type3")] = RecruitmentJob.exchanges.where(:created_at.gte => @startdt, :created_at.lt => enddt).count
|
||||
when "registration"
|
||||
@startdt = DateTime.parse("#{year}/#{month}")
|
||||
enddt = DateTime.parse("#{year}/#{month.to_i + 1}")
|
||||
if month.to_i < 12
|
||||
enddt = DateTime.parse("#{year}/#{month.to_i + 1}")
|
||||
else
|
||||
enddt = DateTime.parse("#{year.to_i + 1}/1")
|
||||
end
|
||||
@data = {}
|
||||
@data[t("recruitment.user_type.type1")] = RecruitProfile.employees.where(:created_at.gte => @startdt, :created_at.lt => enddt).count
|
||||
@data[t("recruitment.user_type.type2")] = RecruitProfile.employers.where(:created_at.gte => @startdt, :created_at.lt => enddt).count
|
||||
when "filled"
|
||||
@startdt = DateTime.parse("#{year}/#{month}")
|
||||
enddt = DateTime.parse("#{year}/#{month.to_i + 1}")
|
||||
if month.to_i < 12
|
||||
enddt = DateTime.parse("#{year}/#{month.to_i + 1}")
|
||||
else
|
||||
enddt = DateTime.parse("#{year.to_i + 1}/1")
|
||||
end
|
||||
@data = {}
|
||||
@data[t("recruitment.post_t.type1")] = RecruitmentJob.jobs.filled.where(:created_at.gte => @startdt, :created_at.lt => enddt).count
|
||||
@data[t("recruitment.post_t.type2")] = RecruitmentJob.internships.filled.where(:created_at.gte => @startdt, :created_at.lt => enddt).count
|
||||
|
|
Loading…
Reference in New Issue