From 0cb964b237b80cf4ed435e0537ec47a72a9d40e2 Mon Sep 17 00:00:00 2001 From: cxt Date: Wed, 6 Sep 2017 15:32:54 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B6=85=E7=BA=A7=E7=AE=A1=E7=90=86=E5=91=98?= =?UTF-8?q?=E7=9A=84=E8=AF=95=E7=94=A8=E7=94=B3=E8=AF=B7=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E6=9C=89=E7=82=B9=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/user.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/models/user.rb b/app/models/user.rb index 5f04e57d6..8afdf1c34 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -574,10 +574,12 @@ class User < Principal def identity ue = self.user_extensions unless ue.blank? - if ue.technical_title.blank? - ue.identity == 0 ? "老师" : (ue.identity == 1 ? "学生" : "专业人士") + if ue.identity == 0 + result = ue.technical_title ? ue.technical_title : "老师" + elsif ue.identity == 1 + result = "学生" else - result = ue.technical_title + result = ue.technical_title ? ue.technical_title : "专业人士" end end end