weizong song 5 years ago
parent 1dfc8f6806
commit 94e8116683

@ -19,6 +19,16 @@ class Paramedic extends SoftDeletesModel
public function getAvatarUrlAttribute() public function getAvatarUrlAttribute()
{ {
$protocol = request()->secure() ? "https" : "http"; $protocol = request()->secure() ? "https" : "http";
if (!$this->avatar) {
switch ($this->sex) {
case "男":
$this->avatar = "/images/male.png";
break;
case "女":
$this->avatar = "/images/female.png";
break;
}
}
return $this->avatar ? $protocol . "://" . request()->getHost() . $this->avatar : $this->avatar; return $this->avatar ? $protocol . "://" . request()->getHost() . $this->avatar : $this->avatar;
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Loading…
Cancel
Save