?php
namespace App\Model;
use Illuminate\Database\Eloquent\Model;
class Goods extends Model
{
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']);
}
}