12345678910111213141516171819 |
- <?php
- /**
- * Created by PhpStorm.
- * User: zilongs
- * Date: 20-10-4
- * Time: 下午4:35
- */
- namespace App\Models;
- class Nurse extends BaseModel
- {
- protected $appends = ['today'];
- public function getTodayAttribute()
- {
- $id = $this->attributes['id'];
- return OrderNurse::where(['nurse_id'=>$id,'created_at'=>['>',date('Y-m-d 00:00:00',time())]])->count();
- }
- }
|