添加非空判断
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').
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
<div id="account">
|
||||
<%= render_menu :account_menu -%>
|
||||
</div>
|
||||
<% if User.current.logged? -%>
|
||||
<% if User.current.logged? -%>
|
||||
<div id="loggedas">
|
||||
<ul style="padding:0 0; margin:0 0;display:inline;">
|
||||
<li style="padding:0 0; margin:0 0;display:inline;border-bottom: 0;" class="loggedas_li">
|
||||
|
|
Loading…
Reference in New Issue