最近登录用户列表中无法正确显示单位名称

This commit is contained in:
cxt 2017-03-06 14:40:16 +08:00
parent 54c16753cb
commit 686cf8b926
1 changed files with 1 additions and 9 deletions

View File

@ -92,15 +92,7 @@
<% end%> <% end%>
</td> </td>
<td align="center"> <td align="center">
<% unless user.user_extensions.nil? %> <%= user.user_extensions.school_id.nil? ? "" : (School.find user.user_extensions.school_id).try(:name) %>
<% 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 %>
<% end %>
</td> </td>
</tr> </tr>
<% end %> <% end %>