mirror of
https://gitee.com/ulthon/ulthon_admin.git
synced 2026-07-01 15:32: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);
|
||||
|
||||
@@ -44,6 +44,7 @@
|
||||
<th>封面</th>
|
||||
<th>简介</th>
|
||||
<th>排序</th>
|
||||
<th>状态</th>
|
||||
<th>操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -57,6 +58,7 @@
|
||||
<td><img src="{$vo.poster}" alt=""></td>
|
||||
<td>{$vo.desc}</td>
|
||||
<td>{$vo.sort}</td>
|
||||
<td>{$vo.status_name}</td>
|
||||
<td>
|
||||
<div class="layui-btn-container">
|
||||
<a class="layui-btn layui-btn-sm" href="{:url('edit',['id'=>$vo.id])}">编辑</a>
|
||||
|
||||
Reference in New Issue
Block a user