修改默认时间处理

This commit is contained in:
邹景立 2022-04-30 17:27:21 +08:00
parent 4435dcf61a
commit 2ac2f95e1f
2 changed files with 19 additions and 1 deletions

View File

@ -11,5 +11,13 @@ use think\admin\Model;
*/ */
class ShopGoodsItem extends Model class ShopGoodsItem extends Model
{ {
/**
* 格式化创建时间
* @param string $value
* @return string
*/
public function getCreateAtAttr(string $value): string
{
return format_datetime($value);
}
} }

View File

@ -20,4 +20,14 @@ class ShopGoodsMark extends Model
$map = ['status' => 1]; $map = ['status' => 1];
return static::mk()->where($map)->order('sort desc,id desc')->column('name'); 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);
}
} }