管理功能升级

This commit is contained in:
2016-06-27 17:53:01 +08:00
parent 81b6167106
commit 028187797d
15 changed files with 453 additions and 136 deletions

View File

@@ -11,7 +11,7 @@ return array(
'user_administrator' => 1,
'url_common_param'=>true,
//'url_common_param'=>true,
'template' => array(
),

View File

@@ -48,11 +48,12 @@ class Content extends Admin{
$grid_list = get_grid_list($this->modelInfo['list_grid']);
$order = "id desc";
$map = array();
$field = array_filter($grid_list['fields']);
if ($this->modelInfo['extend'] == 1) {
$map['model_id'] = $this->modelInfo['id'];
array_push($field, 'is_top');
}
$field = array_filter($grid_list['fields']);
$list = $this->model->where($map)->field($field)->order($order)->paginate(15);
$data = array(
@@ -60,9 +61,14 @@ class Content extends Admin{
'list' => $list,
'page' => $list->render()
);
if($this->modelInfo['template_list']){
$template = 'content/' . $this->modelInfo['template_list'];
}else{
$template = 'content/index';
}
$this->assign($data);
$this->setMeta($this->modelInfo['title'] . "列表");
return $this->fetch('content/index');
return $this->fetch($template);
}
/**
@@ -104,7 +110,7 @@ class Content extends Admin{
return $this->error($this->model->getError(),'');
}
}else{
$id = input('get.id','','trim,intval');
$id = input('id','','trim,intval');
if (!$id) {
return $this->error("非法操作!");
}
@@ -129,7 +135,7 @@ class Content extends Admin{
*/
public function del(){
$id = input('get.id','','trim');
$ids = input('post.ids/a',array());
$ids = input('post.ids',array());
array_push($ids, $id);
if (empty($ids)) {
return $this->error("非法操作!");

View File

@@ -60,7 +60,7 @@ class Model extends Admin{
* @author huajie <banhuajie@163.com>
*/
public function edit() {
$id = input('get.id', '');
$id = input('id', '', 'trim,intval');
if (empty($id)) {
return $this->error('参数不能为空!');
}

View File

@@ -35,7 +35,7 @@
{else/}
{volist name="list" id="item"}
<tr>
<td><input class="ids row-selected" type="checkbox" name="ids[]" value="{$item['id']}"></td>
<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>
@@ -44,6 +44,13 @@
{/if}
{/volist}
<td>
{if isset($item['is_top'])}
{if $item['is_top']}
<a href="{:url('admin/content/is_top',array('id'=>$item['id'],'model_id'=>$model_id,'is_top'=>'0'))}" class="ajax-get">取消置顶</a>
{else/}
<a href="{:url('admin/content/is_top',array('id'=>$item['id'],'model_id'=>$model_id,'is_top'=>'1'))}" class="ajax-get">置顶</a>
{/if}
{/if}
{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>

View File

@@ -63,6 +63,16 @@
<span class="help-block">选“是”则会新建默认的id字段作为主键</span>
</div>
</div>
<div class="form-group">
<label class="col-lg-2 control-label">是否会员显示</label>
<div class="col-lg-10">
<select name="is_user_show" class="form-control" style="width:auto">
<option value="1" selected="selected"></option>
<option value="0"></option>
</select>
<span class="help-block">选“是”则会新建默认的id字段作为主键</span>
</div>
</div>
<div class="form-group">
<label class="col-lg-2 control-label">模型图标</label>
<div class="col-lg-6 col-sm-10">

View File

@@ -47,6 +47,16 @@
<span class="help-block">(目前只支持独立模型和文档模型)</span>
</div>
</div>
<div class="form-group">
<label class="col-lg-2 control-label">是否会员显示</label>
<div class="col-lg-10">
<select name="is_user_show" class="form-control" style="width:auto">
<option value="1" {if $info['is_user_show'] ==1}selected="selected"{/if}></option>
<option value="0" {if $info['is_user_show'] ==0}selected="selected"{/if}></option>
</select>
<span class="help-block">选“是”则会新建默认的id字段作为主键</span>
</div>
</div>
<div class="form-group">
<label class="col-lg-2 control-label">模型图标</label>
<div class="col-lg-6 col-sm-10">
@@ -127,21 +137,21 @@
<label class="col-lg-2 control-label">列表模板</label>
<div class="col-lg-6 col-sm-10">
<input type="text" class="form-control" name="template_list" value="{$info['template_list']|default=''}">
<span class="help-block">(自定义的列表模板,放在Application\Admin\View\Think下,不写则使用默认模板)</span>
<span class="help-block">(自定义的列表模板,放在application\admin\view\content下,不写则使用默认模板)</span>
</div>
</div>
<div class="form-group">
<label class="col-lg-2 control-label">新增模板</label>
<div class="col-lg-6 col-sm-10">
<input type="text" class="form-control" name="template_add" value="{$info['template_add']|default=''}">
<span class="help-block">(自定义的新增模板,放在Application\Admin\View\Think下,不写则使用默认模板)</span>
<span class="help-block">(自定义的新增模板,放在application\admin\view\content下,不写则使用默认模板)</span>
</div>
</div>
<div class="form-group">
<label class="col-lg-2 control-label">编辑模板</label>
<div class="col-lg-6 col-sm-10">
<input type="text" class="form-control" name="template_edit" value="{$info['template_edit']|default=''}">
<span class="help-block">(自定义的编辑模板,放在Application\Admin\View\Think下,不写则使用默认模板)</span>
<span class="help-block">(自定义的编辑模板,放在application\admin\view\content下,不写则使用默认模板)</span>
</div>
</div>
<div class="form-group">

View File

@@ -9,6 +9,17 @@
</div>
</header>
<div class="main-box-body clearfix">
<div class="row" style="padding: 10px;">
<div class="col-sm-12">
<form class="form form-inline" method="post">
<div class="form-group">
<label for="order_no">订单号:</label>
<input type="text" class="form-control" name="order_no" id="order_no" placeholder="订单号">
</div>
<button type="submit" class="btn btn-primary">查找</button>
</form>
</div>
</div>
<div class="table-responsive clearfix">
{volist name="list" id="item"}
<div class="panel panel-info">