12345678910111213141516171819 |
- <?php
- /**
- * Created by PhpStorm.
- * User: zilongs
- * Date: 20-10-1
- * Time: 上午12:10
- */
- namespace App\Models;
- class Patient extends BaseModel
- {
- protected $appends = ['age'];
- public function getAgeAttribute()
- {
- return birthday_to_age($this->birthday);
- }
- }
|