diff --git a/app/Models/Paramedic.php b/app/Models/Paramedic.php index d094393..49381bc 100755 --- a/app/Models/Paramedic.php +++ b/app/Models/Paramedic.php @@ -19,6 +19,16 @@ class Paramedic extends SoftDeletesModel public function getAvatarUrlAttribute() { $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; } diff --git a/public/images/female.png b/public/images/female.png new file mode 100644 index 0000000..89d0c20 Binary files /dev/null and b/public/images/female.png differ diff --git a/public/images/male.png b/public/images/male.png new file mode 100644 index 0000000..180a2f3 Binary files /dev/null and b/public/images/male.png differ