mirror of
https://gitee.com/ulthon/ulthon_admin.git
synced 2026-07-06 01:52:48 +08:00
显示文章状态
This commit is contained in:
@@ -14,6 +14,11 @@ class Post extends Model
|
||||
{
|
||||
//
|
||||
|
||||
public static $stausNameList = [
|
||||
0=>'不发布',
|
||||
1=>'发布'
|
||||
];
|
||||
|
||||
use SoftDelete;
|
||||
|
||||
protected $defaultSoftDelete = 0;
|
||||
@@ -28,6 +33,11 @@ class Post extends Model
|
||||
return $this->hasMany(PostTag::class,'post_id');
|
||||
}
|
||||
|
||||
public function getStatusNameAttr()
|
||||
{
|
||||
return self::$stausNameList[$this->getData('status')];
|
||||
}
|
||||
|
||||
public function setPubishTimeAttr($value)
|
||||
{
|
||||
return strtotime($value);
|
||||
|
||||
Reference in New Issue
Block a user