海工商新版后台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

35 lines
808 B

<?php
namespace App\Models;
use Dcat\Admin\Traits\HasDateTimeFormatter;
use Illuminate\Database\Eloquent\Model;
class SchoolOpeningTime extends Model
{
use HasDateTimeFormatter;
protected $table = 'school_opening_time';
public $timestamps = false;
public function setStartTimeAttribute($value)
{
$this->attributes['start_time'] = is_int($value) ? $value : strtotime($value);
}
public function getStartTimeAttribute()
{
return date('Y-m-d H:i:s', $this->attributes['start_time']);
}
public function setEndTimeAttribute($value)
{
$this->attributes['end_time'] = is_int($value) ? $value : strtotime($value);
}
public function getEndTimeAttribute()
{
return date('Y-m-d H:i:s', $this->attributes['end_time']);
}
}