Patient.php 287 B

12345678910111213141516171819
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: zilongs
  5. * Date: 20-10-1
  6. * Time: 上午12:10
  7. */
  8. namespace App\Models;
  9. class Patient extends BaseModel
  10. {
  11. protected $appends = ['age'];
  12. public function getAgeAttribute()
  13. {
  14. return birthday_to_age($this->birthday);
  15. }
  16. }