From dddff27e784655586c1670cf5c28e9cc0c770176 Mon Sep 17 00:00:00 2001 From: vine_liutk <961510893@qq.com> Date: Mon, 20 Mar 2023 11:40:30 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=A0=BC=E5=BC=8F=E5=8C=96?= =?UTF-8?q?=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Admin/Controllers/AdminNoticeController.php | 4 +++- app/Models/AdminNotice.php | 3 +++ app/Models/Keyword.php | 4 ++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/app/Admin/Controllers/AdminNoticeController.php b/app/Admin/Controllers/AdminNoticeController.php index b7646a1..1d7a0b7 100644 --- a/app/Admin/Controllers/AdminNoticeController.php +++ b/app/Admin/Controllers/AdminNoticeController.php @@ -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('更新时间') ]); diff --git a/app/Models/AdminNotice.php b/app/Models/AdminNotice.php index 00ea281..496c4c1 100644 --- a/app/Models/AdminNotice.php +++ b/app/Models/AdminNotice.php @@ -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'); + } } diff --git a/app/Models/Keyword.php b/app/Models/Keyword.php index 8c53e54..644c10f 100644 --- a/app/Models/Keyword.php +++ b/app/Models/Keyword.php @@ -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() {