@ -21,7 +21,7 @@ class UpdateContributor < ActiveRecord::Migration
# 课程留言数
journal_count=JournalsForMessage.where("user_id =? and jour_id =? and jour_type =? ",s.user_id,course.id,"Course").count*1
# 作业留言
journal_homework_count=JournalsForMessage.where("user_id =? and jour_id =? and jour_type =? ",s.user_id,course.id,"HomeworkCommon").count*1
journal_homework_count=JournalsForMessage.find_by_sql("SELECT jfm.* FROM `journals_for_messages` jfm, homework_commons hc where hc.id = jfm.jour_id and hc.course_id =#{course.id} and jfm.user_id =#{s.user_id} and jfm.jour_type ='HomeworkCommon';").count*1
# journal_count = CourseActivity.where("user_id =? and course_id =? and course_act_type =?", s.student_id, course.id, "JournalsForMessage").count * 1
# journal_reply_count = JournalsForMessage.where("user_id =? and jour_id =? and jour_type =? and status =?", s.student_id, course.id, "Course",1).count * 1