@ -50,7 +50,8 @@ class CollegesController < ApplicationController
# Redo:这样做内存会卡死的
# Redo:这样做内存会卡死的
# user_ids = User.find_by_sql("SELECT users.id FROM users LEFT JOIN user_extensions ON users.id=user_extensions.user_id WHERE user_extensions.`school_id` = #{@school.id}").map(&:id)
# user_ids = User.find_by_sql("SELECT users.id FROM users LEFT JOIN user_extensions ON users.id=user_extensions.user_id WHERE user_extensions.`school_id` = #{@school.id}").map(&:id)
# Redo:是否直接使用count会更好
# Redo:是否直接使用count会更好
all_course_ids=Course.joins("join users u on courses.tea_id = u.id").joins("join user_extensions ue on u.id = ue.user_id").where("courses.id != 1309 and ue.school_id = #{@school.id}")
all_course_ids=Course.joins("join users u on courses.tea_id = u.id").joins("join user_extensions ue on u.id = ue.user_id").
where("courses.id != 1309 and courses.is_delete = 0 and ue.school_id = #{@school.id}")