列表页
This commit is contained in:
parent
6b848dced3
commit
d633094b83
29
hyhproject/admin/controller/LogSysData.php
Normal file
29
hyhproject/admin/controller/LogSysData.php
Normal file
@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace wstmart\admin\controller;
|
||||
|
||||
use wstmart\admin\model\LogSysData as M;
|
||||
|
||||
class LogSysData extends Base
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
return $this->fetch("list");
|
||||
}
|
||||
|
||||
public function index2()
|
||||
{
|
||||
return $this->fetch("list2");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取分页
|
||||
*/
|
||||
public function pageQuery(){
|
||||
$m = new M();
|
||||
$rs = $m->pageQuery();
|
||||
return WSTGrid($rs);
|
||||
}
|
||||
|
||||
}
|
37
hyhproject/admin/model/LogSysData.php
Normal file
37
hyhproject/admin/model/LogSysData.php
Normal file
@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace wstmart\admin\model;
|
||||
|
||||
|
||||
use think\Db;
|
||||
|
||||
class LogSysData extends Base
|
||||
{
|
||||
protected $createTime = "create_time";
|
||||
protected $dateFormat = false;
|
||||
protected $updateTime = false;
|
||||
/**
|
||||
* 分页
|
||||
*/
|
||||
|
||||
public function pageQuery(){
|
||||
$sort = input('sort');
|
||||
$where = [];
|
||||
$type = input('type/d');
|
||||
$where['type'] = $type;
|
||||
$order = 'a.id desc';
|
||||
if($sort){
|
||||
$sort = str_replace('.',' ',$sort);
|
||||
$order = $sort;
|
||||
}
|
||||
|
||||
$page = $this->field(true)
|
||||
->order($order)
|
||||
->paginate(input('post.limit/d'))->toArray();
|
||||
|
||||
return $page;
|
||||
|
||||
}
|
||||
|
||||
}
|
25
hyhproject/admin/view/log_sys_data/list.html
Normal file
25
hyhproject/admin/view/log_sys_data/list.html
Normal file
@ -0,0 +1,25 @@
|
||||
{extend name="base" /}
|
||||
{block name="css"}
|
||||
<link rel="stylesheet" type="text/css" href="__ADMIN__/js/mmgrid/mmGrid.css?v={$v}" />
|
||||
{/block}
|
||||
{block name="js"}
|
||||
<script src="__ADMIN__/js/mmgrid/mmGrid.js?v={$v}" type="text/javascript"></script>
|
||||
<script src="__ADMIN__/log_sys_data/log_sys_data.js?v={$v}" type="text/javascript"></script>
|
||||
<script>
|
||||
$(function(){initGrid();})
|
||||
</script>
|
||||
{/block}
|
||||
{block name="main"}
|
||||
<div class="wst-toolbar">
|
||||
<div id="ztreeMenuContent" class="ztreeMenuContent">
|
||||
<ul id="dropDownTree" class="ztree" style="margin-top:0; width:250px; height: 300px;"></ul>
|
||||
</div>
|
||||
<input type='text' id='key' placeholder='规则标题'/>
|
||||
<button class="btn btn-primary" onclick='javascript:loadGrid()'><i class='fa fa-search'></i>查询</button>
|
||||
<div style='clear:both'></div>
|
||||
</div>
|
||||
<div class='wst-grid'>
|
||||
<div id="mmg" class="mmg"></div>
|
||||
<div id="pg" style="text-align: right;"></div>
|
||||
</div>
|
||||
{/block}
|
25
hyhproject/admin/view/log_sys_data/list2.html
Normal file
25
hyhproject/admin/view/log_sys_data/list2.html
Normal file
@ -0,0 +1,25 @@
|
||||
{extend name="base" /}
|
||||
{block name="css"}
|
||||
<link rel="stylesheet" type="text/css" href="__ADMIN__/js/mmgrid/mmGrid.css?v={$v}" />
|
||||
{/block}
|
||||
{block name="js"}
|
||||
<script src="__ADMIN__/js/mmgrid/mmGrid.js?v={$v}" type="text/javascript"></script>
|
||||
<script src="__ADMIN__/log_sys_data/log_sys_data2.js?v={$v}" type="text/javascript"></script>
|
||||
<script>
|
||||
$(function(){initGrid();})
|
||||
</script>
|
||||
{/block}
|
||||
{block name="main"}
|
||||
<div class="wst-toolbar">
|
||||
<div id="ztreeMenuContent" class="ztreeMenuContent">
|
||||
<ul id="dropDownTree" class="ztree" style="margin-top:0; width:250px; height: 300px;"></ul>
|
||||
</div>
|
||||
<input type='text' id='key' placeholder='规则标题'/>
|
||||
<button class="btn btn-primary" onclick='javascript:loadGrid()'><i class='fa fa-search'></i>查询</button>
|
||||
<div style='clear:both'></div>
|
||||
</div>
|
||||
<div class='wst-grid'>
|
||||
<div id="mmg" class="mmg"></div>
|
||||
<div id="pg" style="text-align: right;"></div>
|
||||
</div>
|
||||
{/block}
|
39
hyhproject/admin/view/log_sys_data/log_sys_data.js
Normal file
39
hyhproject/admin/view/log_sys_data/log_sys_data.js
Normal file
@ -0,0 +1,39 @@
|
||||
var mmg;
|
||||
function initGrid(){
|
||||
var h = WST.pageHeight();
|
||||
var cols = [
|
||||
{title:'类型', name:'type' ,width:200,renderer: function(val,item,rowIndex){
|
||||
if(val == 1) return '代快付';
|
||||
else return '代慢付'
|
||||
}},
|
||||
{title:'金额', name:'title' ,width:200,renderer: function(val,item,rowIndex){
|
||||
if(item.changeType!=1){
|
||||
val = '-'+val;
|
||||
}
|
||||
return "¥"+val;
|
||||
}},
|
||||
{title:'创建时间', name:'create_time' ,width:120,sortable:true},
|
||||
];
|
||||
|
||||
mmg = $('.mmg').mmGrid({height: h-85,indexCol: true, cols: cols,method:'POST',checkCol:true,multiSelect:true,
|
||||
url: WST.U('admin/logSysData/pageQuery?type=1'), fullWidthRows: true, autoLoad: true,remoteSort: true,
|
||||
plugins: [
|
||||
$('#pg').mmPaginator({})
|
||||
]
|
||||
});
|
||||
mmg.on('loadSuccess',function(){
|
||||
layui.form.render('','gridForm');
|
||||
layui.form.on('switch(isShow)', function(data){
|
||||
var id = $(this).attr("data");
|
||||
if(this.checked){
|
||||
toggleIsShow(1,id);
|
||||
}else{
|
||||
toggleIsShow(0,id);
|
||||
}
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
function loadGrid(){
|
||||
mmg.load({page:1});
|
||||
}
|
39
hyhproject/admin/view/log_sys_data/log_sys_data2.js
Normal file
39
hyhproject/admin/view/log_sys_data/log_sys_data2.js
Normal file
@ -0,0 +1,39 @@
|
||||
var mmg;
|
||||
function initGrid(){
|
||||
var h = WST.pageHeight();
|
||||
var cols = [
|
||||
{title:'类型', name:'type' ,width:200,renderer: function(val,item,rowIndex){
|
||||
if(val == 1) return '代快付';
|
||||
else return '代慢付'
|
||||
}},
|
||||
{title:'金额', name:'title' ,width:200,renderer: function(val,item,rowIndex){
|
||||
if(item.changeType!=1){
|
||||
val = '-'+val;
|
||||
}
|
||||
return "¥"+val;
|
||||
}},
|
||||
{title:'创建时间', name:'create_time' ,width:120,sortable:true},
|
||||
];
|
||||
|
||||
mmg = $('.mmg').mmGrid({height: h-85,indexCol: true, cols: cols,method:'POST',checkCol:true,multiSelect:true,
|
||||
url: WST.U('admin/logSysData/pageQuery?type=2'), fullWidthRows: true, autoLoad: true,remoteSort: true,
|
||||
plugins: [
|
||||
$('#pg').mmPaginator({})
|
||||
]
|
||||
});
|
||||
mmg.on('loadSuccess',function(){
|
||||
layui.form.render('','gridForm');
|
||||
layui.form.on('switch(isShow)', function(data){
|
||||
var id = $(this).attr("data");
|
||||
if(this.checked){
|
||||
toggleIsShow(1,id);
|
||||
}else{
|
||||
toggleIsShow(0,id);
|
||||
}
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
function loadGrid(){
|
||||
mmg.load({page:1});
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user