目录结构调整
This commit is contained in:
@@ -244,14 +244,9 @@ class Addons extends Admin {
|
||||
public function addhook(){
|
||||
$hooks = model('Hooks');
|
||||
if (IS_POST) {
|
||||
$data = input();
|
||||
if ($data) {
|
||||
$result = $hooks->change($data);
|
||||
if ($result !== false) {
|
||||
return $this->success("修改成功");
|
||||
}else{
|
||||
return $this->error($hooks->getError());
|
||||
}
|
||||
$result = $hooks->change();
|
||||
if ($result !== false) {
|
||||
return $this->success("修改成功");
|
||||
}else{
|
||||
return $this->error($hooks->getError());
|
||||
}
|
||||
@@ -270,14 +265,9 @@ class Addons extends Admin {
|
||||
public function edithook($id){
|
||||
$hooks = model('Hooks');
|
||||
if (IS_POST) {
|
||||
$data = input('post.');
|
||||
if ($data) {
|
||||
$result = $hooks->change($data);
|
||||
if ($result !== false) {
|
||||
return $this->success("修改成功");
|
||||
}else{
|
||||
return $this->error($hooks->getError());
|
||||
}
|
||||
$result = $hooks->change();
|
||||
if ($result !== false) {
|
||||
return $this->success("修改成功");
|
||||
}else{
|
||||
return $this->error($hooks->getError());
|
||||
}
|
||||
|
||||
@@ -50,8 +50,9 @@ class Content extends Admin{
|
||||
$map = $this->buildMap();
|
||||
$field = array_filter($grid_list['fields']);
|
||||
if ($this->modelInfo['extend'] == 1) {
|
||||
$map['model_id'] = $this->modelInfo['id'];
|
||||
array_push($field, 'is_top');
|
||||
}else{
|
||||
unset($map['model_id']);
|
||||
}
|
||||
|
||||
$list = $this->model->where($map)->field($field)->order($order)->paginate(15);
|
||||
@@ -249,21 +250,27 @@ class Content extends Admin{
|
||||
*/
|
||||
protected function buildMap(){
|
||||
$map = array();
|
||||
$keyword = input('get.keyword', '', 'trim');
|
||||
$category = input('get.category', '', 'trim');
|
||||
|
||||
if ($keyword) {
|
||||
$map['title'] = array("LIKE", "%$keyword%");
|
||||
}
|
||||
if ($category){
|
||||
$map['category_id'] = $category;
|
||||
$data = $this->request->get();
|
||||
foreach ($data as $key => $value) {
|
||||
if ($value) {
|
||||
if ($key == 'keyword') {
|
||||
$map['title'] = array("LIKE", "%$value%");
|
||||
}elseif($key == 'category'){
|
||||
$map['category_id'] = $value;
|
||||
}elseif($key == 'create_time'){
|
||||
$map['create_time'] = array('BETWEEN',array(strtotime($value[0]),strtotime($value[1])));
|
||||
}else{
|
||||
$map[$key] = $value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->modelInfo['extend'] == 1) {
|
||||
$category = isset($data['category']) ? $data['category'] : '';
|
||||
$cate_list = parse_field_bind('category', $category, $this->modelInfo['id']);
|
||||
$this->assign('cate_list', $cate_list);
|
||||
}
|
||||
$this->assign($this->request->get());
|
||||
$this->assign($data);
|
||||
return $map;
|
||||
}
|
||||
|
||||
|
||||
@@ -23,9 +23,7 @@ class Group extends Admin {
|
||||
|
||||
|
||||
//会员分组首页控制器
|
||||
public function index(){
|
||||
$type = input('get.type','admin','trim');
|
||||
|
||||
public function index($type = 'admin'){
|
||||
$map['module'] = $type;
|
||||
|
||||
$list = db('AuthGroup')->where($map)->order('id desc')->paginate(10);
|
||||
@@ -112,9 +110,7 @@ class Group extends Admin {
|
||||
}
|
||||
|
||||
//权限节点控制器
|
||||
public function access(){
|
||||
$type = input('get.type','admin','trim');
|
||||
|
||||
public function access($type = 'admin'){
|
||||
$map['module'] = $type;
|
||||
|
||||
$list = db('AuthRule')->where($map)->order('id desc')->paginate(10);
|
||||
@@ -253,8 +249,7 @@ class Group extends Admin {
|
||||
}
|
||||
}
|
||||
|
||||
public function delnode(){
|
||||
$id = input('id','','trim,intval');
|
||||
public function delnode($id){
|
||||
if (!$id) {
|
||||
return $this->error("非法操作!");
|
||||
}
|
||||
|
||||
@@ -118,11 +118,8 @@ class User extends Admin{
|
||||
* del
|
||||
* @author colin <colin@tensent.cn>
|
||||
*/
|
||||
public function del(){
|
||||
$ids = input('post.ids');
|
||||
//多条删除和单条删除
|
||||
empty($ids) ? $ids = input('get.id') : $ids = $ids;
|
||||
$uid = array('IN',is_array($ids) ? implode(',',$ids) : $ids);
|
||||
public function del($id){
|
||||
$uid = array('IN',is_array($id) ? implode(',',$id) : $id);
|
||||
//获取用户信息
|
||||
$find = $this->getUserinfo($uid);
|
||||
model('User')->where(array('uid'=>$uid))->delete();
|
||||
|
||||
@@ -3,6 +3,7 @@ html,body {
|
||||
-webkit-font-smoothing:antialiased;
|
||||
}
|
||||
a.badge{color: #ffffff;}
|
||||
.pt-5{padding-top: 5px;}
|
||||
textarea{resize:none; min-height: 80px;}
|
||||
@media (max-width:419px) {
|
||||
html,body {
|
||||
|
||||
124
application/admin/view/content/book.html
Normal file
124
application/admin/view/content/book.html
Normal file
@@ -0,0 +1,124 @@
|
||||
{extend name="public/base"/}
|
||||
{block name="style"}
|
||||
<!-- datepicker statr -->
|
||||
<link href="__PUBLIC__/plugs/datepicker/css/foundation-datepicker.min.css" rel="stylesheet" type="text/css">
|
||||
<script src="__PUBLIC__/plugs/datepicker/js/foundation-datepicker.js"></script>
|
||||
<script src="__PUBLIC__/plugs/datepicker/js/foundation-datepicker.zh-CN.js"></script>
|
||||
<!-- datepicker end -->
|
||||
{/block}
|
||||
{block name="body"}
|
||||
<div class="main-box clearfix">
|
||||
<header class="main-box-header clearfix">
|
||||
<div class="pull-left">
|
||||
<h2>{$meta_title}</h2>
|
||||
</div>
|
||||
<div class="pull-right">
|
||||
<a class="btn btn-primary" href="{:url('admin/content/add?model_id='.$model_id)}">新 增</a>
|
||||
<button class="btn btn-danger ajax-post confirm" url="{:url('admin/content/del?model_id='.$model_id)}" target-form="ids">删 除</button>
|
||||
</div>
|
||||
</header>
|
||||
<div class="main-box-body clearfix">
|
||||
<div class="row">
|
||||
<form method="get">
|
||||
<div class="col-sm-12 col-md-4 pt-5">
|
||||
<div class="input-group">
|
||||
<div class="input-group-addon">书名:</div>
|
||||
<input type="text" class="form-control" name="book_name" value="{$book_name|default=''}" placeholder="书名">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-12 col-md-4 pt-5">
|
||||
<div class="input-group">
|
||||
<div class="input-group-addon">发布时间:</div>
|
||||
<div class="col-sm-5">
|
||||
<input type="text" class="form-control create_time" name="create_time[]" id="create_time" placeholder="开始时间" value="{$create_time[0]|default=''}" readonly>
|
||||
</div>
|
||||
<div class="col-sm-5">
|
||||
<input type="text" class="form-control create_time" name="create_time[]" id="create_time" placeholder="结束时间" value="{$create_time[1]|default=''}" readonly>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-12 col-md-4 pt-5">
|
||||
<div class="input-group">
|
||||
<div class="input-group-addon">标准类型:</div>
|
||||
<select class="form-control" name="stand_class"></select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-12 col-md-4 pt-5">
|
||||
<div class="input-group">
|
||||
<div class="input-group-addon">编号:</div>
|
||||
<input type="text" class="form-control" name="book_no" value="{$book_no|default=''}" placeholder="编号">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-12 col-md-4 pt-5">
|
||||
<button class="btn btn-primary" type="submit">搜索</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="table-responsive clearfix">
|
||||
|
||||
<div class="table-responsive clearfix">
|
||||
<table class="table table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="30"><input class="checkbox check-all" type="checkbox"></th>
|
||||
{volist name="grid['grids']" id="item"}
|
||||
<th>{$item['title']}</th>
|
||||
{/volist}
|
||||
<th>操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{if condition="empty($list)"}
|
||||
{php}
|
||||
$cow = count($grid['grids'])+2;
|
||||
{/php}
|
||||
<tr>
|
||||
<td colspan="{$cow}" align="center">暂无数据!</td>
|
||||
</tr>
|
||||
{else/}
|
||||
{volist name="list" id="item"}
|
||||
<tr>
|
||||
<td><input class="ids row-selected" type="checkbox" name="id[]" value="{$item['id']}"></td>
|
||||
{volist name="grid['grids']" id="vo"}
|
||||
{if isset($vo['format'])}
|
||||
<td>{$item[$vo['field'][0]]|$vo['format']}</td>
|
||||
{else/}
|
||||
<td>{$item[$vo['field'][0]]}</td>
|
||||
{/if}
|
||||
{/volist}
|
||||
<td>
|
||||
{if isset($item['status'])}
|
||||
{if $item['status']}
|
||||
<a href="{:url('admin/content/status',array('id'=>$item['id'],'model_id'=>$model_id,'status'=>'0'))}" class="ajax-get">取消审核</a>
|
||||
{else/}
|
||||
<a href="{:url('admin/content/status',array('id'=>$item['id'],'model_id'=>$model_id,'status'=>'1'))}" class="ajax-get">审核</a>
|
||||
{/if}
|
||||
{/if}
|
||||
<a href="{:url('admin/content/edit',array('id'=>$item['id'],'model_id'=>$model_id))}" >编辑</a>
|
||||
<a href="{:url('admin/content/del',array('id'=>$item['id'],'model_id'=>$model_id))}" class="ajax-get confirm">删除</a>
|
||||
</td>
|
||||
</tr>
|
||||
{/volist}
|
||||
{/if}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{$page}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/block}
|
||||
{block name="script"}
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
$('.create_time').fdatepicker({
|
||||
format: 'yyyy-mm-dd',
|
||||
pickTime: true
|
||||
});
|
||||
|
||||
$('.height_btn').click(function(){
|
||||
$('.height').show();
|
||||
});
|
||||
})
|
||||
</script>
|
||||
{/block}
|
||||
Reference in New Issue
Block a user