dev_cs
cxt 5 years ago
parent 905c5b9d53
commit 78bbd8cd69

@ -20,7 +20,7 @@ class ShixunSearchService < ApplicationService
if User.current.admin? || User.current.business? if User.current.admin? || User.current.business?
@shixuns = Shixun.none_closed.where(hidden: 0) @shixuns = Shixun.none_closed.where(hidden: 0)
else else
none_shixun_ids = ShixunSchool.where("school_id != #{current_user.school_id}").pluck(:shixun_id) none_shixun_ids = ShixunSchool.where("school_id != #{User.current.school_id}").pluck(:shixun_id)
@shixuns = Shixun.where.not(id: none_shixun_ids).none_closed.where(hidden: 0) @shixuns = Shixun.where.not(id: none_shixun_ids).none_closed.where(hidden: 0)
end end

Loading…
Cancel
Save