123456789101112131415161718192021222324252627282930313233343536373839 |
- <?php
- /**
- * Created by PhpStorm.
- * User: zilongs
- * Date: 20-10-4
- * Time: 下午4:35
- */
- namespace App\Models;
- class Nurse extends BaseModel
- {
- protected $appends = ['today'];
- const NURSEFREE = 1,NURSEFEE = 2;
- public static $_type = [
- self::NURSEFREE=>'免费',
- self::NURSEFEE=>'自费'
- ];
- public static function getNursetype ()
- {
- return self::$_type;
- }
- public function getTodayAttribute()
- {
- return OrderNurse::where(['nurse_id' => $this->id, 'created_at' => ['>', date('Y-m-d 00:00:00', time())]])->count();
- }
- public function getDoctersAttribute($value)
- {
- return explode(',',$value);
- }
- public function setDoctersAttribute($value)
- {
- $this->attributes['docters'] = implode(',', $value);
- }
- }
|