首页更多报错
This commit is contained in:
parent
b6ebbab830
commit
8ccc39ae71
|
@ -281,12 +281,11 @@ class CoursesController < ApplicationController
|
|||
if @school_id == "0" or @school_id.nil?
|
||||
@courses_all = Course.active.visible.
|
||||
joins("LEFT JOIN #{CourseStatus.table_name} ON #{Course.table_name}.id = #{CourseStatus.table_name}.course_id").
|
||||
where("#{Course.table_name}.course_type = ? ", Course::CourseType_course)
|
||||
else
|
||||
@courses_all = Course.active.visible.
|
||||
joins("LEFT JOIN #{CourseStatus.table_name} ON #{Course.table_name}.id = #{CourseStatus.table_name}.course_id").
|
||||
joins(:course_extra).
|
||||
where("#{Course.table_name}.course_type = ? AND #{Course.table_name}.school_id = ?", Course::CourseType_course, @school_id)
|
||||
where("#{Course.table_name}.school_id = ?", @school_id)
|
||||
end
|
||||
|
||||
@course_count = @courses_all.count
|
||||
|
@ -407,8 +406,7 @@ class CoursesController < ApplicationController
|
|||
else
|
||||
@courses_all = Course.active.visible.
|
||||
joins("LEFT JOIN #{CourseStatus.table_name} ON #{Course.table_name}.id = #{CourseStatus.table_name}.course_id").
|
||||
joins(:course_extra).
|
||||
where("#{Course.table_name}.course_type = ? AND #{Course.table_name}.school_id = ?", Course::CourseType_course, @school_id)
|
||||
where("#{Course.table_name}.school_id = ?", @school_id)
|
||||
end
|
||||
|
||||
@course_count = @courses_all.count
|
||||
|
|
Loading…
Reference in New Issue