关联课堂的显示问题

dev_local_lzdx
daiao 4 years ago
parent 883e458a92
commit 4866d634e5

@ -349,7 +349,7 @@ class EcCoursesController < ApplicationController
if user.try(:admin?) || user.try(:business?)
courses = Course.where(:is_delete => 0).limit(20)
else
course_ids = Member.where("user_id = #{user.try(:id)} and course_id != -1").pluck(:course_id)
course_ids = CourseMember.where("user_id = #{user.try(:id)} and role in(1,2,3)").pluck(:course_id)
courses = Course.where(:is_delete => 0, :id => course_ids).limit(20)
end
if params[:search] && params[:search].strip != ""

Loading…
Cancel
Save