课堂首页的数据隔离

dev_home
cxt 5 years ago
parent 3f055011f3
commit fe50f0c18b

@ -61,7 +61,7 @@ class CoursesController < ApplicationController
@user = current_user
# 根据分类查询课堂(全部,我的,最新,最热)
@order = params[:order].present? ? params[:order] : "all"
@courses = current_laboratory.main_site? ? Course.not_deleted : current_laboratory.courses.not_deleted
@courses = current_laboratory.courses.not_deleted
if @order == "visits"
order_str = "courses.id = 1309 DESC, courses.visits DESC"
@courses = @courses.where(is_hidden: 0)

Loading…
Cancel
Save