修改课程删除后可以显示的问题

This commit is contained in:
huang 2016-01-04 17:08:15 +08:00
parent 7f751cfc63
commit 0d6ad9ffac
1 changed files with 1 additions and 1 deletions

View File

@ -875,7 +875,7 @@ class UsersController < ApplicationController
#显示更多用户课程
def user_courses4show
@page = params[:page].to_i + 1
@courses = @user.courses.visible.select("courses.*,(SELECT MAX(created_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS a").order("a desc").limit(5).offset(@page * 5)
@courses = @user.courses.visible.where("is_delete =?", 0).select("courses.*,(SELECT MAX(created_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS a").order("a desc").limit(5).offset(@page * 5)
end
#显示更多用户项目