实训课程发送至功能修复

dev_forum
daiao 5 years ago
parent 4122ccf438
commit 76028ceca5

@ -164,8 +164,8 @@ class SubjectsController < ApplicationController
end end
def choose_course def choose_course
course_ids = Course.find_by_sql("SELECT c.id FROM courses c, members m, member_roles mr course_ids = Course.find_by_sql("SELECT c.id FROM courses c, course_members m
WHERE m.course_id = c.id AND m.id=mr.member_id AND mr.role_id in (3,7,9) WHERE m.course_id = c.id AND m.role in (1,2,3)
AND m.user_id=#{current_user.id} AND c.is_delete = 0 AND c.is_end = 0").map(&:id) AND m.user_id=#{current_user.id} AND c.is_delete = 0 AND c.is_end = 0").map(&:id)
@courses = Course.where(id: course_ids) @courses = Course.where(id: course_ids)
@none_shixun_ids = ShixunSchool.where("school_id != #{current_user.user_extension.try(:school_id)}").pluck(:shixun_id) @none_shixun_ids = ShixunSchool.where("school_id != #{current_user.user_extension.try(:school_id)}").pluck(:shixun_id)

Loading…
Cancel
Save