diff --git a/app/Models/User.php b/app/Models/User.php index c0f9717..a73486a 100755 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -91,14 +91,14 @@ class User extends Authenticatable implements Auditable return $this->username; } -// public function getMobileAttribute($value) -// { -// // 如果url中包含admin字符串,则所有的手机号显示中间4位星号代替 -// if (strpos(request()->url(), 'admin') !== false && env('APP_ENV') == 'local') { -// return substr_replace($value, '****', 3, 4); -// } -// return $value; -// } + public function getMobileAttribute($value) + { + // 如果url中包含admin字符串,则所有的手机号显示中间4位星号代替 + if (strpos(request()->url(), 'admin') !== false && env('APP_ENV') == 'local') { + return substr_replace($value, '****', 3, 4); + } + return $value; + } public function getAppointmentTotalAttribute($value) {