添加非空判断
This commit is contained in:
parent
2f2c6c39b5
commit
d1b20dddef
|
@ -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').
|
||||
|
|
Loading…
Reference in New Issue