|
|
|
@ -170,11 +170,15 @@ module OrganizationsHelper
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def org_teacher_resource_count user
|
|
|
|
|
results = Attachment.find_by_sql("SELECT count(*) FROM attachments where author_id = #{user.id};").count
|
|
|
|
|
results = Attachment.find_by_sql("SELECT * FROM attachments where author_id = #{user.id};").count
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def org_teacher_course_count user
|
|
|
|
|
results = Course.find_by_sql("select count(*) from courses where courses.tea_id = #{user.id}").count
|
|
|
|
|
results = Course.find_by_sql("select * from courses where courses.tea_id = #{user.id}").count
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def org_student_course_count user
|
|
|
|
|
course_ids = user.courses.map { |c| c.is_delete == 0 && c.id}
|
|
|
|
|
results = Member.find_by_sql("select id from courses where courses.tea_id = #{user.id}").count
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|