Merge remote-tracking branch 'origin/dev_aliyun' into dev_aliyun

dev_home
杨树明 5 years ago
commit f6e0e432c9

@ -61,13 +61,13 @@ class CoursesController < ApplicationController
@user = current_user
# 根据分类查询课堂(全部,我的,最新,最热)
@order = params[:order].present? ? params[:order] : "all"
@courses = current_laboratory.courses
@courses = current_laboratory.main_site? ? Course.not_deleted : current_laboratory.courses.not_deleted
if @order == "visits"
order_str = "courses.id = 1309 DESC, courses.visits DESC"
@courses = @courses.where(is_delete: 0, is_hidden: 0)
@courses = @courses.where(is_hidden: 0)
else
order_str = "courses.id = 1309 DESC, courses.homepage_show DESC, courses.created_at desc"
@courses = @courses.where(is_delete: 0, is_hidden: 0, is_end: 0)
@courses = @courses.where(is_hidden: 0, is_end: 0)
end
# 金课未开课的不显示在首页

Loading…
Cancel
Save