mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2025-04-06 03:58:04 +08:00
修改新闻数据
This commit is contained in:
parent
f71819fc16
commit
4c31c22ddc
@ -5,11 +5,19 @@ namespace app\data\model;
|
|||||||
use think\admin\Model;
|
use think\admin\Model;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* 新闻内容模型
|
||||||
* Class DataNewsItem
|
* Class DataNewsItem
|
||||||
* @package app\data\model
|
* @package app\data\model
|
||||||
*/
|
*/
|
||||||
class DataNewsItem extends Model
|
class DataNewsItem extends Model
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* 格式化创建时间
|
||||||
|
* @param string $value
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getCreateAtAttr(string $value): string
|
||||||
|
{
|
||||||
|
return format_datetime($value);
|
||||||
|
}
|
||||||
}
|
}
|
@ -4,19 +4,21 @@
|
|||||||
<legend>条件搜索</legend>
|
<legend>条件搜索</legend>
|
||||||
<form action="{:sysuri()}" id="NewsTableSearch" autocomplete="off" class="layui-form layui-form-pane form-search" method="get" onsubmit="return false">
|
<form action="{:sysuri()}" id="NewsTableSearch" autocomplete="off" class="layui-form layui-form-pane form-search" method="get" onsubmit="return false">
|
||||||
|
|
||||||
|
<!-- {notempty name='marks'} -->
|
||||||
<div class="layui-form-item layui-inline">
|
<div class="layui-form-item layui-inline">
|
||||||
<label class="layui-form-label">文章标签</label>
|
<label class="layui-form-label">文章标签</label>
|
||||||
<div class="layui-input-inline">
|
<div class="layui-input-inline">
|
||||||
<select name="mark" class="layui-select" lay-search>
|
<select name="mark" lay-search class="layui-select">
|
||||||
<option value=''>-- 文章标签 --</option>
|
<option value=''>-- 文章标签 --</option>
|
||||||
{foreach $marks as $mark}{if isset($get.mark) and $mark.code eq $get.mark}
|
{foreach $marks as $mark}{if isset($get.mark) and $mark eq $get.mark}
|
||||||
<option selected value="{$mark.code}">{$mark.name} ( {$mark.code} )</option>
|
<option selected value="{$mark.name}">{$mark.name}</option>
|
||||||
{else}
|
{else}
|
||||||
<option value="{$mark.code}">{$mark.name} ( {$mark.code} )</option>
|
<option value="{$mark.name}">{$mark.name}</option>
|
||||||
{/if}{/foreach}
|
{/if}{/foreach}
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<!-- {/notempty} -->
|
||||||
|
|
||||||
<div class="layui-form-item layui-inline">
|
<div class="layui-form-item layui-inline">
|
||||||
<label class="layui-form-label">文章标题</label>
|
<label class="layui-form-label">文章标题</label>
|
||||||
@ -50,9 +52,17 @@
|
|||||||
sort: {field: 'sort desc,id', type: 'desc'},
|
sort: {field: 'sort desc,id', type: 'desc'},
|
||||||
cols: [[
|
cols: [[
|
||||||
{field: 'id', title: 'ID', align: 'center', width: 60, sort: true},
|
{field: 'id', title: 'ID', align: 'center', width: 60, sort: true},
|
||||||
{field: 'mark', title: '文章标签', align: 'center', width: 100},
|
/* {notempty name='marks'} */
|
||||||
|
{
|
||||||
|
field: 'mark', title: '文章标签', align: 'left', minWidth: 100, templet: function (d) {
|
||||||
|
return (d.html = ''), d.mark.forEach(function (val) {
|
||||||
|
d.html += '<span class="layui-badge layui-bg-blue">' + val + '</span>';
|
||||||
|
}), d.html;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
/* {/marks} */
|
||||||
{field: 'name', title: '文章标题', align: 'left', minWidth: 140},
|
{field: 'name', title: '文章标题', align: 'left', minWidth: 140},
|
||||||
{field: 'num_read', title: '阅读数', align: 'center', width: 80, sort: true, style: 'color:blue;font-size:16px'},
|
{field: 'num_read', title: '阅读数', align: 'center', width: 85, sort: true, style: 'color:blue;font-size:16px'},
|
||||||
{field: 'status', title: '状态', align: 'center', width: 80, templet: '#StatusSwitchTpl'},
|
{field: 'status', title: '状态', align: 'center', width: 80, templet: '#StatusSwitchTpl'},
|
||||||
{field: 'create_at', title: '创建时间', align: 'center', width: 170, sort: true},
|
{field: 'create_at', title: '创建时间', align: 'center', width: 170, sort: true},
|
||||||
{toolbar: '#toolbar', title: '操作', align: 'center', width: 100}
|
{toolbar: '#toolbar', title: '操作', align: 'center', width: 100}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user