1
0
Fork 0

添加格式化时间

develop
vine_liutk 2023-03-20 11:40:30 +08:00
parent b8fbc8394a
commit dddff27e78
3 changed files with 10 additions and 1 deletions

View File

@ -14,7 +14,7 @@ class AdminNoticeController extends AdminController
{
protected string $serviceName = AdminNoticeService::class;
protected string $pageTitle = '公告管理';
protected string $pageTitle = '公告管理';//待完善-todo
public function list(): Page
{
@ -55,6 +55,8 @@ class AdminNoticeController extends AdminController
return $this->baseDetail()->body([
TextControl::make()->static(true)->name('id')->label('ID'),
TextControl::make()->static(true)->name('title')->label('标题'),
//-todo
TextControl::make()->static(true)->name('created_at')->label('创建时间'),
TextControl::make()->static(true)->name('updated_at')->label('更新时间')
]);

View File

@ -13,4 +13,7 @@ class AdminNotice extends Model
protected $fillable = ['title', 'content', 'article_id', 'remark', 'is_enable', 'published_at' ,'sort'];
protected function serializeDate(\DateTimeInterface $date){
return $date->format('Y-m-d H:i:s');
}
}

View File

@ -12,6 +12,10 @@ class Keyword extends Model
use Filterable;
protected $fillable = ['name', 'key', 'value', 'parent_id', 'type_key', 'path', 'sort', 'level'];
protected function serializeDate(\DateTimeInterface $date){
return $date->format('Y-m-d H:i:s');
}
protected static function boot()
{