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()
- {
- return OrderNurse::where(['nurse_id' => $this->id, 'created_at' => ['>', date('Y-m-d 00:00:00', time())]])->count();
- }
- }
|