From 2ac2f95e1f119cbbbdb38f927f77d0eeb70e36d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E6=99=AF=E7=AB=8B?= Date: Sat, 30 Apr 2022 17:27:21 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=BB=98=E8=AE=A4=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/data/model/ShopGoodsItem.php | 10 +++++++++- app/data/model/ShopGoodsMark.php | 10 ++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/app/data/model/ShopGoodsItem.php b/app/data/model/ShopGoodsItem.php index 5546873f1..ff444309d 100644 --- a/app/data/model/ShopGoodsItem.php +++ b/app/data/model/ShopGoodsItem.php @@ -11,5 +11,13 @@ use think\admin\Model; */ class ShopGoodsItem extends Model { - + /** + * 格式化创建时间 + * @param string $value + * @return string + */ + public function getCreateAtAttr(string $value): string + { + return format_datetime($value); + } } \ No newline at end of file diff --git a/app/data/model/ShopGoodsMark.php b/app/data/model/ShopGoodsMark.php index 2058bca99..8da4bf3df 100644 --- a/app/data/model/ShopGoodsMark.php +++ b/app/data/model/ShopGoodsMark.php @@ -20,4 +20,14 @@ class ShopGoodsMark extends Model $map = ['status' => 1]; return static::mk()->where($map)->order('sort desc,id desc')->column('name'); } + + /** + * 格式化创建时间 + * @param string $value + * @return string + */ + public function getCreateAtAttr(string $value): string + { + return format_datetime($value); + } } \ No newline at end of file