mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2025-04-06 03:58:04 +08:00
修改默认时间处理
This commit is contained in:
parent
4435dcf61a
commit
2ac2f95e1f
@ -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);
|
||||
}
|
||||
}
|
@ -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);
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user