用户最新列表单位完成,修改了点击最后两页报错的问题

This commit is contained in:
linchun 2016-03-15 09:47:27 +08:00
parent df4ad9f597
commit 4da8a3828f
1 changed files with 8 additions and 6 deletions

View File

@ -92,13 +92,15 @@
<% end%>
</td>
<td align="center">
<% if user.user_extensions.identity.to_i == 0 %>
<% unless user.user_extensions.nil? %>
<% if user.user_extensions.identity.to_i == 0 %>
<!--优先取school中校名如果校名不存在就取occupation-->
<% occupation = user.user_extensions.school_id.nil? ? "" : (School.where("id =?", user.user_extensions.school_id)).first.try(:name) %>
<%= occupation.blank? ? user.user_extensions.occupation : occupation %>
<% else %>
<%= user.user_extensions.occupation %>
<% end %>
<% occupation = user.user_extensions.school_id.nil? ? "" : (School.where("id =?", user.user_extensions.school_id)).first.try(:name) %>
<%= occupation.blank? ? user.user_extensions.occupation : occupation %>
<% else %>
<%= user.user_extensions.occupation %>
<% end %>
<% end %>
</td>
</tr>
<% end %>