个人主页

yutao
yutao 10 years ago
parent bb4c8c340a
commit addf3604ec

@ -452,7 +452,7 @@ class UsersController < ApplicationController
else else
if @user.user_extensions!=nil && @user.user_extensions.identity == 0 #看老师 if @user.user_extensions!=nil && @user.user_extensions.identity == 0 #看老师
query = query.joins("join member_roles r on m.id = r.member_id") query = query.joins("join member_roles r on m.id = r.member_id")
query = query.where("r.role_id in(7,9)") query = query.where("r.role_id in(3,7,9)")
end end
query = query.where(Course.table_name+".is_public = 1") query = query.where(Course.table_name+".is_public = 1")
# TODO or exists (select 1 from courses c2,members m2 where c2.id=m2.course_id and c2.id=#{Course.table_name}.id and m2.user_id= User.current.id) # TODO or exists (select 1 from courses c2,members m2 where c2.id=m2.course_id and c2.id=#{Course.table_name}.id and m2.user_id= User.current.id)

Loading…
Cancel
Save