海工商新版后台
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
636 B

<?php
namespace App\Models;
use Dcat\Admin\Traits\HasDateTimeFormatter;
use Illuminate\Database\Eloquent\Model;
class Config extends Model
{
use HasDateTimeFormatter;
protected $table = 'config';
const CREATED_AT = 'create_time';
const UPDATED_AT = 'update_time';
public $timestamps = true;
public function freshTimestamp()
{
return time();
}
/*避免转换时间戳为时间字符串*/
public function fromDateTime($value)
{
return $value;
}
protected function serializeDate(\DateTimeInterface $date)
{
return $date->format('Y-m-d H:i:s');
}
}