a12j93412890o3u12093u120397812u3()!@U#*(!@m73()!@�\
This commit is contained in:
parent
f33a695fb0
commit
f857cdfac6
|
@ -51,6 +51,7 @@ class ContentResController extends GyListController
|
||||||
->addTableColumn('res_num', '文件个数')
|
->addTableColumn('res_num', '文件个数')
|
||||||
->addTableColumn('url', '跳转链接')
|
->addTableColumn('url', '跳转链接')
|
||||||
->addTableColumn('cate_name', '分类名')
|
->addTableColumn('cate_name', '分类名')
|
||||||
|
->addTableColumn('create_at', '资源时间', 'time')
|
||||||
->addTableColumn('right_button', '操作', 'btn')
|
->addTableColumn('right_button', '操作', 'btn')
|
||||||
->setTableDataList($data_list) // 数据列表
|
->setTableDataList($data_list) // 数据列表
|
||||||
->setTableDataPage($page->show()) // 数据列表分页
|
->setTableDataPage($page->show()) // 数据列表分页
|
||||||
|
@ -112,6 +113,8 @@ class ContentResController extends GyListController
|
||||||
$ent['type'] = $data['type'];
|
$ent['type'] = $data['type'];
|
||||||
$ent['cate'] = $data['cate'] ?? 0;
|
$ent['cate'] = $data['cate'] ?? 0;
|
||||||
$ent['sort'] = $data['sort'];
|
$ent['sort'] = $data['sort'];
|
||||||
|
// create_at 转换为时间戳
|
||||||
|
$ent['create_at'] = $data['create_at'] == '' ? time() : strtotime($data['create_at']);
|
||||||
|
|
||||||
if ($model->createSave($ent) === false) {
|
if ($model->createSave($ent) === false) {
|
||||||
$this->error($model->getError());
|
$this->error($model->getError());
|
||||||
|
@ -132,7 +135,8 @@ class ContentResController extends GyListController
|
||||||
->addFormItem('type', 'radio', '类型', '', $this->types)
|
->addFormItem('type', 'radio', '类型', '', $this->types)
|
||||||
->addFormItem('content', 'textarea', '文字内容')
|
->addFormItem('content', 'textarea', '文字内容')
|
||||||
->addFormItem('res_id', 'files', '相关资源')
|
->addFormItem('res_id', 'files', '相关资源')
|
||||||
->addFormItem('url', 'text', '跳转链接');
|
->addFormItem('url', 'text', '跳转链接')
|
||||||
|
->addFormItem('create_at', 'datetime', '资源时间', "留空填充为当前时间");
|
||||||
// ->addFormItem('url', 'text', '跳转链接', '请填写 http:// 或者 https:// 开头的完整链接');
|
// ->addFormItem('url', 'text', '跳转链接', '请填写 http:// 或者 https:// 开头的完整链接');
|
||||||
if ($is_res) {
|
if ($is_res) {
|
||||||
$builder->addFormItem('cate', 'radio', '分类', '', [
|
$builder->addFormItem('cate', 'radio', '分类', '', [
|
||||||
|
|
|
@ -0,0 +1,49 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Admin\Controller;
|
||||||
|
|
||||||
|
use Gy_Library\GyListController;
|
||||||
|
use Gy_Library\DBCont;
|
||||||
|
|
||||||
|
use Qscmf\Builder\FormBuilder;
|
||||||
|
use Qscmf\Builder\ListBuilder;
|
||||||
|
|
||||||
|
use Qscmf\Builder\TSubBuilder;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 关键词
|
||||||
|
*/
|
||||||
|
|
||||||
|
class VisitController extends GyListController
|
||||||
|
{
|
||||||
|
use TSubBuilder;
|
||||||
|
|
||||||
|
private $belong_to = ['报道媒体', '报道类型'];
|
||||||
|
public function index()
|
||||||
|
{
|
||||||
|
$map = [];
|
||||||
|
$model = D('Visits');
|
||||||
|
$count = $model->getListForCount($map);
|
||||||
|
$per_page = C('ADMIN_PER_PAGE_NUM', null, false);
|
||||||
|
if ($per_page === false) {
|
||||||
|
$page = new \Gy_Library\GyPage($count);
|
||||||
|
} else {
|
||||||
|
$page = new \Gy_Library\GyPage($count, $per_page);
|
||||||
|
}
|
||||||
|
$order = 'date_today desc,id desc';
|
||||||
|
$data_list = $model->getListForPage($map, $page->nowPage, $page->listRows, $order);
|
||||||
|
// 使用Builder快速建立列表页面。
|
||||||
|
$builder = new ListBuilder();
|
||||||
|
|
||||||
|
$builder = $builder->setMetaTitle('访问量管理'); // 设置页面标题
|
||||||
|
// $builder->addTopButton('addnew');
|
||||||
|
// $builder->addTopButton('save', array('title' => '保存排序'));
|
||||||
|
$builder
|
||||||
|
->setNIDByNode(MODULE_NAME, CONTROLLER_NAME, 'index')
|
||||||
|
->addTableColumn('date_today', '日期')
|
||||||
|
->addTableColumn('count', '访问人数')
|
||||||
|
->setTableDataList($data_list) // 数据列表
|
||||||
|
->setTableDataPage($page->show()) // 数据列表分页
|
||||||
|
->display();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,20 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Common\Model;
|
||||||
|
|
||||||
|
use Gy_Library\DBCont;
|
||||||
|
use Illuminate\Support\Facades\DB;
|
||||||
|
|
||||||
|
//新闻资讯
|
||||||
|
class VisitsModel extends \Gy_Library\GyListModel
|
||||||
|
{
|
||||||
|
|
||||||
|
protected $_validate = array(
|
||||||
|
|
||||||
|
);
|
||||||
|
|
||||||
|
protected $_auto = array(
|
||||||
|
|
||||||
|
);
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue