vd/app/Core/Model.php
2018-12-13 14:27:20 +08:00

42 lines
724 B
PHP

<?php
namespace App\Core;
use Dipper\Foundation\Core\Model as Eloquent;
/**
* Base Model.
*/
abstract class Model extends Eloquent
{
protected $guarded = [];
/**
* 模型的「启动」方法
*
* @return void
*/
protected static function boot()
{
parent::boot();
}
public function attributesToArray()
{
$attributes = parent::attributesToArray();
foreach ($attributes as $key => $value) {
if (is_numeric($value) && $value > 4294967295) {
$attributes[$key] = (string) $value;
}
}
return $attributes;
}
public function getDateFormat()
{
return 'Y-m-d H:i:s.u';
}
}