添加非空判断

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').

View File

@ -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">