zilong 4 năm trước cách đây
mục cha
commit
3c25f910bf
1 tập tin đã thay đổi với 2 bổ sung2 xóa
  1. 2 2
      app/Models/Nurse.php

+ 2 - 2
app/Models/Nurse.php

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