修改课程列表动态数显示不正确的BUG

This commit is contained in:
nwb 2014-06-18 15:18:30 +08:00
parent f80e1f811a
commit 80145c5c3b
3 changed files with 9 additions and 1 deletions

View File

@ -520,6 +520,11 @@ class CoursesController < ApplicationController
activities[board.course_id]+=board.messages.where("updated_on>?", date_from).count
end
#news
News.where(course_id: @course_ids).where("created_on>?",date_from).each do |news|
activities[news.course_id]+=1
end
#feedbackc_count
JournalsForMessage.where(jour_id: @course_ids, jour_type: Course).each do |jourformess|
activities[jourformess.jour_id]+=1

View File

@ -8,6 +8,9 @@ class MigrateCourseJournals < ActiveRecord::Migration
journal.jour_id = project.course_extra.id
journal.save
end
# 将自动设置的更新日期还原
sql = ActiveRecord::Base.connection()
sql.insert "update journals_for_messages set updated_on=created_on where jour_type='Course'"
end
end

View File

@ -11,7 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.
ActiveRecord::Schema.define(:version => 20140618105213) do
ActiveRecord::Schema.define(:version => 20140618105214) do
create_table "activities", :force => true do |t|
t.integer "act_id", :null => false