@@ -64,7 +64,8 class TimelogController < ApplicationController | |||||
64 |
|
64 | |||
65 | sql = "SELECT #{sql_select}, tyear, tmonth, tweek, SUM(hours) AS hours" |
|
65 | sql = "SELECT #{sql_select}, tyear, tmonth, tweek, SUM(hours) AS hours" | |
66 | sql << " FROM #{TimeEntry.table_name} LEFT JOIN #{Issue.table_name} ON #{TimeEntry.table_name}.issue_id = #{Issue.table_name}.id" |
|
66 | sql << " FROM #{TimeEntry.table_name} LEFT JOIN #{Issue.table_name} ON #{TimeEntry.table_name}.issue_id = #{Issue.table_name}.id" | |
67 | sql << " WHERE spent_on BETWEEN '%s' AND '%s'" % [ActiveRecord::Base.connection.quoted_date(@date_from.to_time), ActiveRecord::Base.connection.quoted_date(@date_to.to_time)] |
|
67 | sql << " WHERE #{TimeEntry.table_name}.project_id = %s" % @project.id | |
|
68 | sql << " AND spent_on BETWEEN '%s' AND '%s'" % [ActiveRecord::Base.connection.quoted_date(@date_from.to_time), ActiveRecord::Base.connection.quoted_date(@date_to.to_time)] | |||
68 | sql << " GROUP BY #{sql_group_by}, tyear, tmonth, tweek" |
|
69 | sql << " GROUP BY #{sql_group_by}, tyear, tmonth, tweek" | |
69 |
|
70 | |||
70 | @hours = ActiveRecord::Base.connection.select_all(sql) |
|
71 | @hours = ActiveRecord::Base.connection.select_all(sql) |
General Comments 0
You need to be logged in to leave comments.
Login now