添加非空判断

This commit is contained in:
z9hang 2014-09-30 13:50:55 +08:00
parent 2f2c6c39b5
commit d1b20dddef
2 changed files with 2 additions and 2 deletions

View File

@ -137,7 +137,7 @@ module WelcomeHelper
#获取课程列表
# add by nwb
def find_miracle_course(sum=10, max_rate=7, school_id)
if User.current.user_extensions.school.nil? and school_id.nil?
if User.current.user_extensions.nil? && User.current.user_extensions.school.nil? and school_id.nil?
Course.active.visible.
joins(:memberships).
group('members.course_id').