更新channel模块
This commit is contained in:
@@ -23,6 +23,7 @@ class Admin extends Base {
|
||||
'__img__' => '/static/admin/images',
|
||||
'__css__' => '/static/admin/css',
|
||||
'__js__' => '/static/admin/js',
|
||||
'__plugins__' => '/static/plugins',
|
||||
'__public__' => '/static/admin',
|
||||
],
|
||||
];
|
||||
|
||||
@@ -49,6 +49,7 @@ class Base {
|
||||
'__img__' => '/static/front/images',
|
||||
'__css__' => '/static/front/css',
|
||||
'__js__' => '/static/front/js',
|
||||
'__plugins__' => '/static/plugins',
|
||||
'__public__' => '/static/front',
|
||||
],
|
||||
];
|
||||
|
||||
@@ -50,19 +50,20 @@ class Category extends Admin {
|
||||
'module_id' => isset($param['module_id']) ? $param['module_id'] : 0,
|
||||
'model_list' => []
|
||||
];
|
||||
// $this->assign('tree', $list);
|
||||
// $this->assign('model_list', $model_list);
|
||||
// $this->assign('model_id', $model_id);
|
||||
// $this->setMeta('栏目列表');
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* @title 编辑字段
|
||||
*/
|
||||
public function editable($name = null, $value = null, $pk = null) {
|
||||
if ($name && ($value != null || $value != '') && $pk) {
|
||||
db('Category')->where(array('id' => $pk))->setField($name, $value);
|
||||
public function editable() {
|
||||
$name = $this->request->param('name', '');
|
||||
$value = $this->request->param('value', '');
|
||||
$pk = $this->request->param('pk', '');
|
||||
|
||||
if ($name && $value && $pk) {
|
||||
$save[$name] = $value;
|
||||
CategoryM::update($save, ['id' => $pk]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -83,24 +84,26 @@ class Category extends Admin {
|
||||
return $this->error(empty($error) ? '未知错误!' : $error);
|
||||
}
|
||||
} else {
|
||||
$cate = '';
|
||||
if ($pid) {
|
||||
/* 获取上级分类信息 */
|
||||
$cate = db('Category')->find($pid);
|
||||
if (!($cate && 1 == $cate['status'])) {
|
||||
return $this->error('指定的上级分类不存在或被禁用!');
|
||||
}
|
||||
}
|
||||
$subsql = db('Attribute')->where('name', 'category_id')->fetchSql(true)->column('model_id');
|
||||
$model_list = model('Model')->where('id IN ('. $subsql.')')->select();
|
||||
$cate = [];
|
||||
// if ($pid) {
|
||||
// /* 获取上级分类信息 */
|
||||
// $cate = db('Category')->find($pid);
|
||||
// if (!($cate && 1 == $cate['status'])) {
|
||||
// return $this->error('指定的上级分类不存在或被禁用!');
|
||||
// }
|
||||
// }
|
||||
// $subsql = db('Attribute')->where('name', 'category_id')->fetchSql(true)->column('model_id');
|
||||
// $model_list = model('Model')->where('id IN ('. $subsql.')')->select();
|
||||
$model_list = [];
|
||||
|
||||
/* 获取分类信息 */
|
||||
$info = $id ? db('Category')->find($id) : '';
|
||||
$info = $id ? CategoryM::find($id) : [];
|
||||
|
||||
$this->assign('info', $info);
|
||||
$this->assign('model_list', $model_list);
|
||||
$this->assign('category', $cate);
|
||||
$this->setMeta('编辑分类');
|
||||
$this->data = [
|
||||
'info' => $info,
|
||||
'model_list' => $model_list,
|
||||
'category' => $cate
|
||||
];
|
||||
return $this->fetch();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,12 +24,11 @@ class Channel extends Admin {
|
||||
*/
|
||||
public function index(ChannelM $channel, $type = 0) {
|
||||
/* 获取频道列表 */
|
||||
//$map = array('status' => array('gt', -1), 'pid'=>$pid);
|
||||
$map = array('status' => array('gt', -1));
|
||||
$map[] = ['status', '>', -1];
|
||||
if ($type) {
|
||||
$map['type'] = $type;
|
||||
}
|
||||
$list = $channel->where($map)->order('sort asc,id asc')->column('*', 'id');
|
||||
$list = $channel->where($map)->order('sort asc,id asc')->select()->append(['status_text'])->toArray();
|
||||
|
||||
if (!empty($list)) {
|
||||
$tree = new Tree();
|
||||
@@ -60,11 +59,9 @@ class Channel extends Admin {
|
||||
if ($this->request->isPost()) {
|
||||
$data = $this->request->post();
|
||||
if ($data) {
|
||||
$id = ChannelM::save($data);
|
||||
$id = ChannelM::create($data);
|
||||
if ($id) {
|
||||
return $this->success('新增成功', url('index'));
|
||||
//记录行为
|
||||
action_log('update_channel', 'channel', $id, session('user_auth.uid'));
|
||||
return $this->success('新增成功', url('/admin/channel/index'));
|
||||
} else {
|
||||
return $this->error('新增失败');
|
||||
}
|
||||
@@ -72,16 +69,17 @@ class Channel extends Admin {
|
||||
$this->error('新增失败');
|
||||
}
|
||||
} else {
|
||||
$pid = input('pid', 0);
|
||||
$pid = $this->request->param('pid', 0);
|
||||
//获取父导航
|
||||
$parent = "";
|
||||
if (!empty($pid)) {
|
||||
$parent = ChannelM::where(array('id' => $pid))->field('title')->find();
|
||||
$this->assign('parent', $parent);
|
||||
$parent = ChannelM::where(array('id' => $pid))->value('title');
|
||||
}
|
||||
|
||||
$pnav = ChannelM::where(array('pid' => '0'))->select();
|
||||
|
||||
$this->data = [
|
||||
'parent' => $parent,
|
||||
'pnav' => $pnav,
|
||||
'pid' => $pid,
|
||||
'info' => ['pid' => $pid]
|
||||
@@ -95,40 +93,39 @@ class Channel extends Admin {
|
||||
*/
|
||||
public function edit($id = 0) {
|
||||
if ($this->request->isPost()) {
|
||||
$Channel = model('Channel');
|
||||
$data = $this->request->post();
|
||||
if ($data) {
|
||||
if (false !== $Channel->save($data, array('id' => $data['id']))) {
|
||||
//记录行为
|
||||
action_log('update_channel', 'channel', $data['id'], session('user_auth.uid'));
|
||||
return $this->success('编辑成功', url('index'));
|
||||
$result = ChannelM::update($data, ['id' => $data['id']]);
|
||||
if (false !== $result) {
|
||||
return $this->success('编辑成功', url('/admin/channel/index'));
|
||||
} else {
|
||||
return $this->error('编辑失败');
|
||||
}
|
||||
} else {
|
||||
return $this->error($Channel->getError());
|
||||
return $this->error('非法操作!');
|
||||
}
|
||||
} else {
|
||||
$info = array();
|
||||
$pid = $this->request->param('pid', 0);
|
||||
/* 获取数据 */
|
||||
$info = db('Channel')->find($id);
|
||||
$info = ChannelM::find($id);
|
||||
|
||||
if (false === $info) {
|
||||
return $this->error('获取配置信息错误');
|
||||
}
|
||||
|
||||
$pid = input('pid', 0);
|
||||
//获取父导航
|
||||
$parent = "";
|
||||
if (!empty($pid)) {
|
||||
$parent = db('Channel')->where(array('id' => $pid))->field('title')->find();
|
||||
$this->assign('parent', $parent);
|
||||
$parent = ChannelM::where(array('id' => $pid))->value('title');
|
||||
}
|
||||
|
||||
$pnav = db('Channel')->where(array('pid' => '0'))->select();
|
||||
$this->assign('pnav', $pnav);
|
||||
$this->assign('pid', $pid);
|
||||
$this->assign('info', $info);
|
||||
$this->setMeta('编辑导航');
|
||||
$pnav = ChannelM::where(array('pid' => '0'))->select();
|
||||
$this->data = [
|
||||
'parent' => $parent,
|
||||
'pnav' => $pnav,
|
||||
'pid' => $pid,
|
||||
'info' => $info
|
||||
];
|
||||
return $this->fetch();
|
||||
}
|
||||
}
|
||||
@@ -137,19 +134,20 @@ class Channel extends Admin {
|
||||
* @author 麦当苗儿 <zuojiazi@vip.qq.com>
|
||||
*/
|
||||
public function del() {
|
||||
$id = $this->getArrayParam('id');
|
||||
$id = $this->request->param('id', '');
|
||||
|
||||
if (empty($id)) {
|
||||
$map = [];
|
||||
if (!$id) {
|
||||
return $this->error('请选择要操作的数据!');
|
||||
}
|
||||
if (is_array($id)) {
|
||||
$map[] = ['id', 'IN', $id];
|
||||
}else{
|
||||
$map[] = ['id', '=', $id];
|
||||
}
|
||||
|
||||
$map = array('id' => array('in', $id));
|
||||
if (db('Channel')->where($map)->delete()) {
|
||||
//删除category中的ismenu字段记录
|
||||
$map = array('ismenu' => array('in', $id));
|
||||
db('Category')->where($map)->setField('ismenu', 0);
|
||||
//记录行为
|
||||
action_log('update_channel', 'channel', $id, session('user_auth.uid'));
|
||||
$result = ChannelM::where($map)->delete();
|
||||
if (false !== $result) {
|
||||
return $this->success('删除成功');
|
||||
} else {
|
||||
return $this->error('删除失败!');
|
||||
@@ -197,19 +195,20 @@ class Channel extends Admin {
|
||||
* @title 设置状态
|
||||
*/
|
||||
public function setStatus() {
|
||||
$id = array_unique((array) input('ids', 0));
|
||||
$status = input('status', '0', 'trim');
|
||||
|
||||
if (empty($id)) {
|
||||
return $this->error('请选择要操作的数据!');
|
||||
$id = $this->request->param('id', 0);
|
||||
$status = $this->request->param('status', 0);
|
||||
$map = [];
|
||||
if (is_array($id)) {
|
||||
$map[] = ['id', 'IN', $id];
|
||||
}else{
|
||||
$map[] = ['id', '=', $id];
|
||||
}
|
||||
|
||||
$map = array('id' => array('in', $id));
|
||||
$result = db('Channel')->where($map)->update(array('status' => $status));
|
||||
if ($result) {
|
||||
return $this->success("操作成功!");
|
||||
$result = ChannelM::update(['status'=> $status], $map);
|
||||
if ($result !== false) {
|
||||
return $this->success('操作成功!');
|
||||
} else {
|
||||
return $this->error("操作失败!");
|
||||
return $this->error('操作失败!');
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -144,8 +144,8 @@ class Menu extends Admin {
|
||||
$map[] = ['id', '=', $id];
|
||||
}
|
||||
|
||||
|
||||
if (MenuM::where($map)->delete()) {
|
||||
$result = MenuM::where($map)->delete()
|
||||
if (false !== $result) {
|
||||
Cache::pull('admin_menu_list');
|
||||
return $this->success('删除成功');
|
||||
} else {
|
||||
|
||||
47
app/http/form/template/image.html
Normal file
47
app/http/form/template/image.html
Normal file
@@ -0,0 +1,47 @@
|
||||
<div class="picker-box">
|
||||
<div id="picker_{$name}" class="picker_button">上传图片</div>
|
||||
{if isset($value) && $value}
|
||||
<input type="hidden" name="{$name}" id="field_{$name}" value="{$value}">
|
||||
{else/}
|
||||
<input type="hidden" name="{$name}" id="field_{$name}" value="">
|
||||
{/if}
|
||||
<div id="fileList_{$name}" class="upload-file-list-info" style="width:280px;">
|
||||
{if $value}
|
||||
{php}
|
||||
$images = get_cover($value);
|
||||
{/php}
|
||||
<li class="affix-list-item" id="WU_FILE_0">
|
||||
<div class="upload-file-info">
|
||||
<span class="webuploader-pick-file-close" data-queued-id="WU_FILE_0" data-id="{$value}" data-fileurl="{$images['path']}"><i class="close"></i></span>
|
||||
<span class="fname"></span>
|
||||
<span class="fsize">上传时间:{$images['create_time']}</span>
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
<div class="filebox image">
|
||||
<img src="{:config('base_url')}{$images['path']}" class="img-responsive">
|
||||
</div>
|
||||
</li>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
uploadsize = 2;
|
||||
$(function(){
|
||||
$("#picker_{$name}").SentUploader({
|
||||
compress:false,
|
||||
fileNumLimit:1,
|
||||
uploadEvents: {
|
||||
uploadComplete:function(file){}
|
||||
},
|
||||
listName : 'fileList_{$name}',
|
||||
hiddenName: 'field_{$name}',
|
||||
hiddenValType:1,
|
||||
fileSingleSizeLimit:uploadsize*1024*1024,
|
||||
closeX:true
|
||||
},
|
||||
{
|
||||
fileType: 'service',
|
||||
filename : 'images',
|
||||
});
|
||||
});
|
||||
</script>
|
||||
29
app/http/validate/admin/Channel.php
Normal file
29
app/http/validate/admin/Channel.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | SentCMS [ WE CAN DO IT JUST THINK IT ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2013 http://www.tensent.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: molong <molong@tensent.cn> <http://www.tensent.cn>
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\http\validate\admin;
|
||||
|
||||
use think\Validate;
|
||||
|
||||
/**
|
||||
* 菜单验证
|
||||
*/
|
||||
class Channel extends Validate{
|
||||
protected $rule = [
|
||||
'title' => 'require',
|
||||
];
|
||||
|
||||
protected $message = [
|
||||
'title.require' => '导航名称必须',
|
||||
];
|
||||
|
||||
protected $scene = [
|
||||
'add' => ['title'],
|
||||
'edit' => ['title'],
|
||||
];
|
||||
}
|
||||
@@ -20,4 +20,9 @@ class Channel extends \think\Model {
|
||||
|
||||
protected $auto = array('update_time', 'status' => 1);
|
||||
protected $insert = array('create_time');
|
||||
|
||||
protected function getStatusTextAttr($value, $data){
|
||||
$status = [0 => '禁用', 1 => '启用'];
|
||||
return isset($status[$data['status']]) ? $status[$data['status']] : '禁用';
|
||||
}
|
||||
}
|
||||
@@ -18,36 +18,36 @@
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane fade in active" id="tab-base">
|
||||
<div class="form-group">
|
||||
<label class="col-lg-2 control-label">上级分类</label>
|
||||
<div class="col-lg-8">
|
||||
<label class="col-sm-2 control-label">上级分类</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="hidden" name="pid" value="{$category['id']|default=0}">
|
||||
<input type="text" class="form-control" disabled="disabled" value="{$category['title']|default='无'}"/>
|
||||
<span class="help-block"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-lg-2 control-label">分类名称</label>
|
||||
<div class="col-lg-8">
|
||||
<label class="col-sm-2 control-label">分类名称</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="text" name="title" class="form-control" value="{$info.title|default=''}">
|
||||
<span class="help-block">(名称不能为空)</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-lg-2 control-label">分类标识</label>
|
||||
<div class="col-lg-8">
|
||||
<label class="col-sm-2 control-label">分类标识</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="text" name="name" class="form-control" value="{$info.name|default=''}">
|
||||
<span class="help-block">(英文字母)</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-lg-2 control-label">分组定义</label>
|
||||
<div class="col-lg-8">
|
||||
<label class="col-sm-2 control-label">分组定义</label>
|
||||
<div class="col-sm-8">
|
||||
<textarea name="groups" class="form-control">{$info.groups|default=''}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-lg-2 control-label">绑定模型</label>
|
||||
<div class="col-lg-8">
|
||||
<label class="col-sm-2 control-label">绑定模型</label>
|
||||
<div class="col-sm-8">
|
||||
<select name="model_id" class="form-control" style="width: auto;">
|
||||
<option value="">--请选择--</option>
|
||||
{volist name="model_list" id="item"}
|
||||
@@ -57,8 +57,8 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-lg-2 control-label">发布内容</label>
|
||||
<div class="col-lg-8">
|
||||
<label class="col-sm-2 control-label">发布内容</label>
|
||||
<div class="col-sm-8">
|
||||
<label class="am-radio-inline"><input type="radio" name="allow_publish" value="0">不允许</label>
|
||||
<label class="am-radio-inline"><input type="radio" name="allow_publish" value="1" checked>仅允许后台</label>
|
||||
<label class="am-radio-inline"><input type="radio" name="allow_publish" value="2" >允许前后台</label>
|
||||
@@ -66,19 +66,19 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-lg-2 control-label">
|
||||
<label class="col-sm-2 control-label">
|
||||
是否审核
|
||||
</label>
|
||||
<div class="col-lg-8">
|
||||
<div class="col-sm-8">
|
||||
<label class="am-radio-inline"><input type="radio" name="check" value="0" checked>不需要</label>
|
||||
<label class="am-radio-inline"><input type="radio" name="check" value="1">需要</label>
|
||||
<span class="help-block">(在该分类下发布的内容是否需要审核)</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-lg-2 control-label">分类图标</label>
|
||||
<div class="col-lg-8">
|
||||
{:widget('common/Form/show',array(array('name'=>'icon','type'=>'image'),$info))}
|
||||
<label class="col-sm-2 control-label">分类图标</label>
|
||||
<div class="col-sm-8">
|
||||
{:form(['name'=>'icon','type'=>'image'],$info)}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -86,8 +86,8 @@
|
||||
<div class="tab-pane fade" id="tab-better">
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-lg-2 control-label">可见性</label>
|
||||
<div class="col-lg-3">
|
||||
<label class="col-sm-2 control-label">可见性</label>
|
||||
<div class="col-sm-3">
|
||||
<select name="display" class="form-control">
|
||||
<option value="1">所有人可见</option>
|
||||
<option value="0">不可见</option>
|
||||
@@ -97,58 +97,58 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-lg-2 control-label">排序</label>
|
||||
<div class="col-lg-2">
|
||||
<label class="col-sm-2 control-label">排序</label>
|
||||
<div class="col-sm-2">
|
||||
<input type="text" name="sort" class="form-control" value="{$info.sort|default=0}">
|
||||
<span class="help-block">(仅对当前层级分类有效)</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-lg-2 control-label">列表行数</label>
|
||||
<div class="col-lg-5">
|
||||
<label class="col-sm-2 control-label">列表行数</label>
|
||||
<div class="col-sm-5">
|
||||
<input type="text" name="list_row" class="form-control" value="{$info.list_row|default=10}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-lg-2 control-label">网页标题</label>
|
||||
<div class="col-lg-8">
|
||||
<label class="col-sm-2 control-label">网页标题</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="text" name="meta_title" class="form-control" value="{$info.meta_title|default=''}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-lg-2 control-label">关键字</label>
|
||||
<div class="col-lg-8">
|
||||
<label class="col-sm-2 control-label">关键字</label>
|
||||
<div class="col-sm-8">
|
||||
<textarea class="form-control" name="keywords">{$info.keywords|default=''}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-lg-2 control-label">描述</label>
|
||||
<div class="col-lg-8">
|
||||
<label class="col-sm-2 control-label">描述</label>
|
||||
<div class="col-sm-8">
|
||||
<textarea class="form-control" name="description">{$info.description|default=''}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-lg-2 control-label">频道模板</label>
|
||||
<div class="col-lg-8">
|
||||
<label class="col-sm-2 control-label">频道模板</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="text" name="template_index" class="form-control" value="{$info.template_index|default=''}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-lg-2 control-label">列表模板</label>
|
||||
<div class="col-lg-8">
|
||||
<label class="col-sm-2 control-label">列表模板</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="text" name="template_lists" class="form-control" value="{$info.template_lists|default=''}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-lg-2 control-label">详情模板</label>
|
||||
<div class="col-lg-8">
|
||||
<label class="col-sm-2 control-label">详情模板</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="text" name="template_detail" class="form-control" value="{$info.template_detail|default=''}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-lg-2 control-label">编辑模板</label>
|
||||
<div class="col-lg-8">
|
||||
<label class="col-sm-2 control-label">编辑模板</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="text" name="template_edit" class="form-control" value="{$info.template_edit|default=''}">
|
||||
</div>
|
||||
</div>
|
||||
@@ -156,7 +156,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-lg-offset-2 col-lg-10">
|
||||
<div class="col-sm-offset-2 col-sm-10">
|
||||
<input type="hidden" name="id" value="{$info['id']|default=''}">
|
||||
<button type="submit" class="btn btn-success submit-btn ajax-post" target-form="form">确认提交</button>
|
||||
<button class="btn btn-danger btn-return" onclick="javascript:history.back(-1);return false;">返 回</button>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<h2>{$meta_title}</h2>
|
||||
</div>
|
||||
<div class="pull-right">
|
||||
<a class="btn btn-primary" href="{:url('add')}"><i class="fa fa-plus-circle fa-lg"></i> 新 增</a>
|
||||
<a class="btn btn-primary" href="{:url('/admin/category/add')}"><i class="fa fa-plus-circle fa-lg"></i> 新 增</a>
|
||||
</div>
|
||||
</header>
|
||||
<div class="main-box-body clearfix">
|
||||
@@ -17,10 +17,10 @@
|
||||
<div class="table-responsive clearfix">
|
||||
<div class="tabs-wrapper">
|
||||
<ul class="nav nav-tabs">
|
||||
<li {if $module_id == ''}class="active"{/if}><a href="{:url('admin/category/index')}">全部</a></li>
|
||||
<li {if $module_id == ''}class="active"{/if}><a href="{:url('/admin/category/index')}">全部</a></li>
|
||||
{volist name="model_list" id="item"}
|
||||
<li {if $item['id'] == $module_id}class="active"{/if}>
|
||||
<a href="{:url('admin/category/index',array('module_id'=>$item['id']))}">{$item['title']}</a>
|
||||
<a href="{:url('/admin/category/index',array('module_id'=>$item['id']))}">{$item['title']}</a>
|
||||
</li>
|
||||
{/volist}
|
||||
</ul>
|
||||
@@ -45,13 +45,13 @@
|
||||
<td><input class="ids row-selected" type="checkbox" name="id[]" value="{$list.id}"></td>
|
||||
<td>{$list['id']}</td>
|
||||
<td>
|
||||
{$list['level_show']}
|
||||
<a href="#" class="editable editable-click" data-id="{$list['id']}" data-name="title" data-type="text" data-pk="{$list['id']}" data-url="{:url('editable')}">{$list['title']}</a>
|
||||
{$list['level_show']|raw}
|
||||
<a href="#" class="editable editable-click" data-id="{$list['id']}" data-name="title" data-type="text" data-pk="{$list['id']}" data-url="{:url('/admin/category/editable')}">{$list['title']}</a>
|
||||
<a class="add-sub-cate" title="添加子分类" href="{:url('add?pid='.$list['id'])}">
|
||||
<i class="fa fa-plus-square"></i>
|
||||
</a>
|
||||
</td>
|
||||
<td><a href="#" class="editable editable-click" data-id="{$list['id']}" data-name="sort" data-type="text" data-pk="{$list['id']}" data-url="{:url('editable')}">{$list['sort']}</a></td>
|
||||
<td><a href="#" class="editable editable-click" data-id="{$list['id']}" data-name="sort" data-type="text" data-pk="{$list['id']}" data-url="{:url('/admin/category/editable')}">{$list['sort']}</a></td>
|
||||
<td>{$list['allow_publish']?'是':'否'}</td>
|
||||
<td>
|
||||
{if $list['status']}
|
||||
@@ -68,15 +68,15 @@
|
||||
{/if}
|
||||
</td>
|
||||
<td>
|
||||
<a title="编辑" href="{:url('edit?id='.$list['id'].'&pid='.$list['pid'])}">编辑</a>
|
||||
<a title="编辑" href="{:url('/admin/category/edit', ['id' => $list['id'], 'pid' =>$list['pid']])}">编辑</a>
|
||||
{if $list['status']}
|
||||
<a href="{:url('status?id='.$list['id'].'&status=0')}" class="ajax-get">禁用</a>
|
||||
<a href="{:url('/admin/category/status', ['id' => $list['id'], 'status' => 0])}" class="ajax-get">禁用</a>
|
||||
{else/}
|
||||
<a href="{:url('status?id='.$list['id'].'&status=1')}" class="ajax-get">启用</a>
|
||||
<a href="{:url('/admin/category/status', ['id' => $list['id'], 'status' => 1])}" class="ajax-get">启用</a>
|
||||
{/if}
|
||||
<a title="删除" href="{:url('remove?id='.$list['id'])}" class="confirm ajax-get">删除</a>
|
||||
<a title="移动" href="{:url('operate?type=move&from='.$list['id'])}">移动</a>
|
||||
<a title="合并" href="{:url('operate?type=merge&from='.$list['id'])}">合并</a>
|
||||
<a title="删除" href="{:url('/admin/category/remove', ['id' => $list['id']])}" class="confirm ajax-get">删除</a>
|
||||
<a title="移动" href="{:url('/admin/category/operate', ['id' => $list['id'], 'type'=>'move'])}">移动</a>
|
||||
<a title="合并" href="{:url('/admin/category/operate', ['id' => $list['id'], 'type'=>'merge'])}">合并</a>
|
||||
</td>
|
||||
</tr>
|
||||
{/volist}
|
||||
|
||||
@@ -55,14 +55,14 @@
|
||||
<td><a href="#" class="editable editable-click" data-id="{$list['id']}" data-name="sort" data-type="text" data-pk="{$list['id']}" data-url="{:url('/admin/channel/editable')}">{$list['sort']}</a></td>
|
||||
<td>
|
||||
{if $list['status']}
|
||||
<span class="label label-primary">{$list.status|get_status_title}</span>
|
||||
<span class="label label-primary">{$list['status_text']}</span>
|
||||
{else/}
|
||||
<span class="label label-danger">{$list.status|get_status_title}</span>
|
||||
<span class="label label-danger">{$list['status_text']}</span>
|
||||
{/if}
|
||||
</td>
|
||||
<td>
|
||||
<a title="编辑" href="{:url('/admin/channel/edit?id='.$list['id'].'&pid='.$list['pid'])}">编辑</a>
|
||||
<a title="{$list.status|show_status_op}" href="{:url('/admin/channel/setStatus', ['ids'=>$list['id'], 'status'=>abs(1-$list['status'])])}" class="ajax-get">{$list.status|show_status_op}</a>
|
||||
<a title="{$list['status'] ? '禁用' : '启用'}" href="{:url('/admin/channel/setStatus', ['id'=>$list['id'], 'status'=>abs(1-$list['status'])])}" class="ajax-get">{$list['status'] ? '禁用' : '启用'}</a>
|
||||
<a title="删除" href="{:url('/admin/channel/del', ['id' =>$list['id']])}" class="confirm ajax-get">删除</a>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -37,10 +37,10 @@
|
||||
<td>{$item['id']}</td>
|
||||
<td><i class="fa fa-{$item['icon']}"></i> {$item['name']}</td>
|
||||
<td>
|
||||
<a data-id="{$item.id}" href="{:url('model/edit?id='.$item['id'])}">{$item.title}</a>
|
||||
<a data-id="{$item.id}" href="{:url('/admin/model/edit?id='.$item['id'])}">{$item['title']}</a>
|
||||
</td>
|
||||
<td>
|
||||
<span>{$item.create_time|time_format}</span>
|
||||
<span>{$item.create_time}</span>
|
||||
</td>
|
||||
<td>
|
||||
{if $item['status']}
|
||||
|
||||
Reference in New Issue
Block a user