|
|
@ -349,7 +349,7 @@ class EcCoursesController < ApplicationController
|
|
|
|
if user.try(:admin?) || user.try(:business?)
|
|
|
|
if user.try(:admin?) || user.try(:business?)
|
|
|
|
courses = Course.where(:is_delete => 0).limit(20)
|
|
|
|
courses = Course.where(:is_delete => 0).limit(20)
|
|
|
|
else
|
|
|
|
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)
|
|
|
|
courses = Course.where(:is_delete => 0, :id => course_ids).limit(20)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
if params[:search] && params[:search].strip != ""
|
|
|
|
if params[:search] && params[:search].strip != ""
|
|
|
|