更新功能
This commit is contained in:
@@ -34,7 +34,7 @@ class Category extends Admin {
|
|||||||
|
|
||||||
$map[] = ['status', '>', -1];
|
$map[] = ['status', '>', -1];
|
||||||
if (isset($param['model_id']) && $param['model_id']) {
|
if (isset($param['model_id']) && $param['model_id']) {
|
||||||
$map[] = ['model_id', '=', $model_id];
|
$map[] = ['model_id', '=', $param['model_id']];
|
||||||
}
|
}
|
||||||
$list = $category->where($map)->order('sort asc,id asc')->select();
|
$list = $category->where($map)->order('sort asc,id asc')->select();
|
||||||
|
|
||||||
@@ -42,13 +42,14 @@ class Category extends Admin {
|
|||||||
$tree = new \sent\tree\Tree();
|
$tree = new \sent\tree\Tree();
|
||||||
$list = $tree->toFormatTree($list->toArray());
|
$list = $tree->toFormatTree($list->toArray());
|
||||||
}
|
}
|
||||||
$subsql = $attr->where('name', 'category_id')->fetchSql(true)->column('model_id');
|
$model_list = Model::where('id', 'IN', function($query){
|
||||||
$model_list = $model->where('id IN ('. $subsql.')')->select();
|
$query->name('Attribute')->where('name', 'category_id')->field('model_id');
|
||||||
|
})->select();
|
||||||
|
|
||||||
$this->data = [
|
$this->data = [
|
||||||
'tree' => $list,
|
'tree' => $list,
|
||||||
'module_id' => isset($param['module_id']) ? $param['module_id'] : 0,
|
'model_id' => isset($param['model_id']) ? $param['model_id'] : 0,
|
||||||
'model_list' => []
|
'model_list' => $model_list
|
||||||
];
|
];
|
||||||
return $this->fetch();
|
return $this->fetch();
|
||||||
}
|
}
|
||||||
@@ -72,29 +73,20 @@ class Category extends Admin {
|
|||||||
*/
|
*/
|
||||||
public function edit($id = null, $pid = 0) {
|
public function edit($id = null, $pid = 0) {
|
||||||
if ($this->request->isPost()) {
|
if ($this->request->isPost()) {
|
||||||
$category = model('Category');
|
$data = $this->request->post();
|
||||||
//提交表单
|
|
||||||
$result = $category->change();
|
$result = CategoryM::update($data, ['id' => $data['id']]);
|
||||||
if (false !== $result) {
|
if (false !== $result) {
|
||||||
//记录行为
|
return $this->success('修改成功!', url('/admin/category/index'));
|
||||||
action_log('update_category', 'category', $id, session('user_auth.uid'));
|
|
||||||
return $this->success('编辑成功!', url('index'));
|
|
||||||
} else {
|
} else {
|
||||||
$error = $category->getError();
|
return $this->error('修改失败!');
|
||||||
return $this->error(empty($error) ? '未知错误!' : $error);
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$cate = [];
|
$category = CategoryM::getCategoryTree();
|
||||||
// if ($pid) {
|
|
||||||
// /* 获取上级分类信息 */
|
$model_list = Model::where('id', 'IN', function($query){
|
||||||
// $cate = db('Category')->find($pid);
|
$query->name('Attribute')->where('name', 'category_id')->field('model_id');
|
||||||
// if (!($cate && 1 == $cate['status'])) {
|
})->select();
|
||||||
// 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 ? CategoryM::find($id) : [];
|
$info = $id ? CategoryM::find($id) : [];
|
||||||
@@ -102,7 +94,7 @@ class Category extends Admin {
|
|||||||
$this->data = [
|
$this->data = [
|
||||||
'info' => $info,
|
'info' => $info,
|
||||||
'model_list' => $model_list,
|
'model_list' => $model_list,
|
||||||
'category' => $cate
|
'category' => $category
|
||||||
];
|
];
|
||||||
return $this->fetch();
|
return $this->fetch();
|
||||||
}
|
}
|
||||||
@@ -111,36 +103,32 @@ class Category extends Admin {
|
|||||||
/**
|
/**
|
||||||
* @title 添加分类
|
* @title 添加分类
|
||||||
*/
|
*/
|
||||||
public function add($pid = 0) {
|
public function add() {
|
||||||
$Category = model('Category');
|
|
||||||
|
|
||||||
if ($this->request->isPost()) {
|
if ($this->request->isPost()) {
|
||||||
//提交表单
|
//提交表单
|
||||||
$id = $Category->change();
|
$data = $this->request->post();
|
||||||
if (false !== $id) {
|
|
||||||
action_log('update_category', 'category', $id, session('user_auth.uid'));
|
$result = CategoryM::create($data);
|
||||||
return $this->success('新增成功!', url('index'));
|
if (false !== $result) {
|
||||||
|
return $this->success('新增成功!', url('/admin/category/index'));
|
||||||
} else {
|
} else {
|
||||||
$error = $Category->getError();
|
return $this->error('添加失败!');
|
||||||
return $this->error(empty($error) ? '未知错误!' : $error);
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$cate = array();
|
$pid = $this->request->param('pid', 0);
|
||||||
if ($pid) {
|
|
||||||
/* 获取上级分类信息 */
|
$category = CategoryM::getCategoryTree();
|
||||||
$cate = $Category->info($pid, 'id,name,title,status');
|
|
||||||
if (!($cate && 1 == $cate['status'])) {
|
$model_list = Model::where('id', 'IN', function($query){
|
||||||
return $this->error('指定的上级分类不存在或被禁用!');
|
$query->name('Attribute')->where('name', 'category_id')->field('model_id');
|
||||||
}
|
})->select();
|
||||||
}
|
|
||||||
$subsql = db('Attribute')->where('name', 'category_id')->fetchSql(true)->column('model_id');
|
|
||||||
$model_list = model('Model')->where('id IN ('. $subsql.')')->select();
|
|
||||||
|
|
||||||
/* 获取分类信息 */
|
/* 获取分类信息 */
|
||||||
$this->assign('info', null);
|
$this->data = [
|
||||||
$this->assign('model_list', $model_list);
|
'info' => ['pid' => $pid],
|
||||||
$this->assign('category', $cate);
|
'model_list' => $model_list,
|
||||||
$this->setMeta('新增分类');
|
'category' => $category
|
||||||
|
];
|
||||||
return $this->fetch('edit');
|
return $this->fetch('edit');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -153,8 +141,9 @@ class Category extends Admin {
|
|||||||
return $this->error('参数错误!');
|
return $this->error('参数错误!');
|
||||||
}
|
}
|
||||||
//判断该分类下有没有子分类,有则不允许删除
|
//判断该分类下有没有子分类,有则不允许删除
|
||||||
$child = db('Category')->where(array('pid' => $id))->field('id')->select();
|
$child = CategoryM::where('pid', $id)->field('id')->select();
|
||||||
if (!empty($child)) {
|
|
||||||
|
if (!$child->isEmpty()) {
|
||||||
return $this->error('请先删除该分类下的子分类');
|
return $this->error('请先删除该分类下的子分类');
|
||||||
}
|
}
|
||||||
//判断该分类下有没有内容
|
//判断该分类下有没有内容
|
||||||
@@ -163,10 +152,8 @@ class Category extends Admin {
|
|||||||
// return $this->error('请先删除该分类下的文章(包含回收站)');
|
// return $this->error('请先删除该分类下的文章(包含回收站)');
|
||||||
// }
|
// }
|
||||||
//删除该分类信息
|
//删除该分类信息
|
||||||
$res = db('Category')->where(array('id' => $id))->delete();
|
$result = CategoryM::where('id', $id)->delete();
|
||||||
if ($res !== false) {
|
if ($result !== false) {
|
||||||
//记录行为
|
|
||||||
action_log('update_category', 'category', $id, session('user_auth.uid'));
|
|
||||||
return $this->success('删除分类成功!');
|
return $this->success('删除分类成功!');
|
||||||
} else {
|
} else {
|
||||||
return $this->error('删除分类失败!');
|
return $this->error('删除分类失败!');
|
||||||
@@ -268,19 +255,20 @@ class Category extends Admin {
|
|||||||
* @author huajie <banhuajie@163.com>
|
* @author huajie <banhuajie@163.com>
|
||||||
*/
|
*/
|
||||||
public function status() {
|
public function status() {
|
||||||
$id = $this->getArrayParam('id');
|
$id = $this->request->param('id', 0);
|
||||||
$status = input('status', '0', 'trim,intval');
|
$status = $this->request->param('status', 0);
|
||||||
|
$map = [];
|
||||||
if (!$id) {
|
if (is_array($id)) {
|
||||||
return $this->error("非法操作!");
|
$map[] = ['id', 'IN', $id];
|
||||||
|
}else{
|
||||||
|
$map[] = ['id', '=', $id];
|
||||||
}
|
}
|
||||||
|
|
||||||
$map['id'] = array('IN', $id);
|
$result = CategoryM::update(['status'=> $status], $map);
|
||||||
$result = db('Category')->where($map)->setField('status', $status);
|
if ($result !== false) {
|
||||||
if ($result) {
|
return $this->success('操作成功!');
|
||||||
return $this->success("设置成功!");
|
|
||||||
} else {
|
} else {
|
||||||
return $this->error("设置失败!");
|
return $this->error('操作失败!');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
29
app/http/validate/admin/Category.php
Normal file
29
app/http/validate/admin/Category.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 Category extends Validate{
|
||||||
|
protected $rule = [
|
||||||
|
'title' => 'require',
|
||||||
|
];
|
||||||
|
|
||||||
|
protected $message = [
|
||||||
|
'title.require' => '栏目名称必须',
|
||||||
|
];
|
||||||
|
|
||||||
|
protected $scene = [
|
||||||
|
'add' => ['title'],
|
||||||
|
'edit' => ['title'],
|
||||||
|
];
|
||||||
|
}
|
||||||
@@ -21,6 +21,16 @@ class Category extends \think\Model{
|
|||||||
'icon' => 'integer',
|
'icon' => 'integer',
|
||||||
);
|
);
|
||||||
|
|
||||||
|
public static function getCategoryTree($map = []){
|
||||||
|
$list = self::where($map)->select();
|
||||||
|
|
||||||
|
if (!empty($list)) {
|
||||||
|
$tree = new \sent\tree\Tree();
|
||||||
|
$list = $tree->toFormatTree($list->toArray());
|
||||||
|
}
|
||||||
|
return $list;
|
||||||
|
}
|
||||||
|
|
||||||
public function change() {
|
public function change() {
|
||||||
$data = input('post.');
|
$data = input('post.');
|
||||||
if ($data['id']) {
|
if ($data['id']) {
|
||||||
|
|||||||
@@ -12,10 +12,9 @@ namespace app\model;
|
|||||||
/**
|
/**
|
||||||
* 设置模型
|
* 设置模型
|
||||||
*/
|
*/
|
||||||
class ContentModel {
|
class Content extends Model {
|
||||||
|
|
||||||
|
protected $auto = ['update_time'];
|
||||||
|
protected $insert = ['create_time', 'status' => 1];
|
||||||
|
|
||||||
protected $type = array(
|
|
||||||
'create_time' => 'integer',
|
|
||||||
'update_time' => 'integer',
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
@@ -15,64 +15,60 @@ namespace app\model;
|
|||||||
class Model extends \think\Model{
|
class Model extends \think\Model{
|
||||||
|
|
||||||
protected $auto = ['update_time'];
|
protected $auto = ['update_time'];
|
||||||
protected $insert = ['name', 'create_time', 'status' => 1, 'list_grid' => "id:ID\r\ntitle:标题\r\ncreate_time:添加时间|time_format\r\nupdate_time:更新时间|time_format"];
|
protected $insert = ['name', 'create_time', 'status' => 1, 'list_grid' => "id:ID\r\ntitle:标题\r\ncreate_time:添加时间\r\nupdate_time:更新时间"];
|
||||||
protected $type = array(
|
protected $type = array(
|
||||||
'id' => 'integer',
|
'id' => 'integer'
|
||||||
'create_time' => 'integer',
|
|
||||||
'update_time' => 'integer',
|
|
||||||
);
|
);
|
||||||
|
|
||||||
// protected static function init() {
|
protected static function onAfterInsert($model){
|
||||||
// self::beforeInsert(function ($event) {
|
$data = $model->getDate();
|
||||||
// $data = $event->toArray();
|
|
||||||
// $tablename = strtolower($data['name']);
|
|
||||||
// //实例化一个数据库操作类
|
|
||||||
// $db = new \com\Datatable();
|
|
||||||
// //检查表是否存在并创建
|
|
||||||
// if (!$db->CheckTable($tablename)) {
|
|
||||||
// //创建新表
|
|
||||||
// return $db->initTable($tablename, $data['title'], 'id')->query();
|
|
||||||
// } else {
|
|
||||||
// return false;
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// self::afterInsert(function ($event) {
|
|
||||||
// $data = $event->toArray();
|
|
||||||
|
|
||||||
// $fields = include (APP_PATH . 'admin/fields.php');
|
$fields = [
|
||||||
// if (!empty($fields)) {
|
'title'=> ['name' => 'title', 'title' => '标题', 'type' => 'text', 'length' => 200, 'extra' => '', 'remark' => '标题', 'is_show' => 1, 'is_must' => 1, 'value'=>''],
|
||||||
// foreach ($fields as $key => $value) {
|
'category_id' => ['name' => 'category_id', 'title' => '栏目', 'type' => 'bind', 'length' => 10, 'extra' => 'category', 'remark' => '栏目', 'is_show' => 1, 'is_must' => 1, 'value'=>'0'],
|
||||||
// if ($data['is_doc']) {
|
'uid' => ['name' => 'uid', 'title' => '用户UID', 'type' => 'num', 'length' => 11, 'extra' => '', 'remark' => '用户UID', 'is_show' => 0, 'is_must' => 1, 'value'=>'0'],
|
||||||
// $fields[$key]['model_id'] = $data['id'];
|
'cover_id' => ['name' => 'cover_id', 'title' => '内容封面', 'type' => 'image', 'length' => 10, 'extra' => '', 'remark' => '内容封面', 'is_show' => 1, 'is_must' => 0, 'value'=>''],
|
||||||
// } else {
|
'description' => ['name' => 'description', 'title' => '内容描述', 'type' => 'textarea', 'length' => '', 'extra' => '', 'remark' => '内容描述', 'is_show' => 1, 'is_must' => 0, 'value'=>''],
|
||||||
// if (in_array($key, array('uid', 'status', 'view', 'create_time', 'update_time'))) {
|
'content' => ['name' => 'content', 'title' => '内容', 'type' => 'editor', 'length' => '', 'extra' => '', 'remark' => '内容', 'is_show' => 1, 'is_must' => 0, 'value'=>''],
|
||||||
// $fields[$key]['model_id'] = $data['id'];
|
'status' => ['name' => 'status', 'title' => '数据状态', 'type' => 'select', 'length' => 2, 'extra' => "-1:删除\r\n0:禁用\r\n1:正常\r\n2:待审核\r\n3:草稿", 'remark' => '数据状态', 'is_show' => 1, 'is_must' => 1, 'value'=>'1'],
|
||||||
// } else {
|
'is_top' => ['name' => 'is_top', 'title' => '是否置顶', 'type' => 'bool', 'length' => 2, 'extra' => '', 'remark' => '是否置顶', 'is_show' => 0, 'is_must' => 1, 'value'=>'0'],
|
||||||
// unset($fields[$key]);
|
'view' => ['name' => 'view', 'title' => '浏览数量', 'type' => 'num', 'length' => 11, 'extra' => '', 'remark' => '浏览数量', 'is_show' => 0, 'is_must' => 1, 'value'=>'0'],
|
||||||
// }
|
'update_time' => ['name' => 'update_time', 'title' => '更新时间', 'type' => 'datetime', 'length' => 11, 'extra' => '', 'remark' => '更新时间', 'is_show' => 0, 'is_must' => 1, 'value'=>'0'],
|
||||||
// }
|
'create_time' => ['name' => 'create_time', 'title' => '添加时间', 'type' => 'datetime', 'length' => 11, 'extra' => '', 'remark' => '添加时间', 'is_show' => 0, 'is_must' => 1, 'value'=>'0'],
|
||||||
// }
|
];
|
||||||
// model('Attribute')->saveAll($fields);
|
if (!empty($fields)) {
|
||||||
// }
|
foreach ($fields as $key => $value) {
|
||||||
// return true;
|
if ($data['is_doc']) {
|
||||||
// });
|
$fields[$key]['model_id'] = $data['id'];
|
||||||
// self::beforeUpdate(function ($event) {
|
} else {
|
||||||
// $data = $event->toArray();
|
if (in_array($key, array('uid', 'status', 'view', 'create_time', 'update_time'))) {
|
||||||
// if (isset($data['attribute_sort']) && $data['attribute_sort']) {
|
$fields[$key]['model_id'] = $data['id'];
|
||||||
// $attribute_sort = json_decode($data['attribute_sort'], true);
|
} else {
|
||||||
|
unset($fields[$key]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
(new Attribute())->saveAll($fields);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
// if (!empty($attribute_sort)) {
|
protected static function onAfterUpdate($model){
|
||||||
// foreach ($attribute_sort as $key => $value) {
|
$data = $model->getDate();
|
||||||
// db('Attribute')->where('id', 'IN', $value)->setField('group_id', $key);
|
if (isset($data['attribute_sort']) && $data['attribute_sort']) {
|
||||||
// foreach ($value as $k => $v) {
|
$attribute_sort = json_decode($data['attribute_sort'], true);
|
||||||
// db('Attribute')->where('id', $v)->setField('sort', $k);
|
|
||||||
// }
|
if (!empty($attribute_sort)) {
|
||||||
// }
|
foreach ($attribute_sort as $key => $value) {
|
||||||
// }
|
db('Attribute')->where('id', 'IN', $value)->setField('group_id', $key);
|
||||||
// }
|
foreach ($value as $k => $v) {
|
||||||
// return true;
|
db('Attribute')->where('id', $v)->setField('sort', $k);
|
||||||
// });
|
}
|
||||||
// }
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
protected function setAttributeSortAttr($value) {
|
protected function setAttributeSortAttr($value) {
|
||||||
return $value ? json_encode($value) : '';
|
return $value ? json_encode($value) : '';
|
||||||
|
|||||||
@@ -32,7 +32,8 @@
|
|||||||
"xin/helper": "^1.0.0",
|
"xin/helper": "^1.0.0",
|
||||||
"sent/tree": "^1.0.0",
|
"sent/tree": "^1.0.0",
|
||||||
"lotofbadcode/phpspirit_dbskeleton": "^1.0",
|
"lotofbadcode/phpspirit_dbskeleton": "^1.0",
|
||||||
"sent/think-addons": "^1.0.0"
|
"sent/think-addons": "^1.0.0",
|
||||||
|
"overtrue/wechat": "^4.2"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"symfony/var-dumper": "^4.2"
|
"symfony/var-dumper": "^4.2"
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ return [
|
|||||||
// 存储连接标识 当type使用cache的时候有效
|
// 存储连接标识 当type使用cache的时候有效
|
||||||
'store' => null,
|
'store' => null,
|
||||||
// 过期时间
|
// 过期时间
|
||||||
'expire' => 1440,
|
'expire' => 1000 * 60 * 60,
|
||||||
// 前缀
|
// 前缀
|
||||||
'prefix' => '',
|
'prefix' => '',
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
<div class="main-box-body clearfix">
|
<div class="main-box-body clearfix">
|
||||||
<form action="{:url()}" method="post" class="form form-horizontal">
|
<form method="post" class="form form-horizontal">
|
||||||
<div class="tabs-wrapper">
|
<div class="tabs-wrapper">
|
||||||
<ul class="nav nav-tabs">
|
<ul class="nav nav-tabs">
|
||||||
<li class="active">
|
<li class="active">
|
||||||
@@ -20,8 +20,12 @@
|
|||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-2 control-label">上级分类</label>
|
<label class="col-sm-2 control-label">上级分类</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<input type="hidden" name="pid" value="{$category['id']|default=0}">
|
<select class="form-control" style="width: auto" name="pid">
|
||||||
<input type="text" class="form-control" disabled="disabled" value="{$category['title']|default='无'}"/>
|
<option value="">请选择</option>
|
||||||
|
{volist name="category" id="item"}
|
||||||
|
<option value="{$item['id']}" {if isset($info['pid']) && $item['id'] == $info['pid']}selected{/if}>{$item['title_show']|raw}</option>
|
||||||
|
{/volist}
|
||||||
|
</select>
|
||||||
<span class="help-block"></span>
|
<span class="help-block"></span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -17,10 +17,10 @@
|
|||||||
<div class="table-responsive clearfix">
|
<div class="table-responsive clearfix">
|
||||||
<div class="tabs-wrapper">
|
<div class="tabs-wrapper">
|
||||||
<ul class="nav nav-tabs">
|
<ul class="nav nav-tabs">
|
||||||
<li {if $module_id == ''}class="active"{/if}><a href="{:url('/admin/category/index')}">全部</a></li>
|
<li {if $model_id == ''}class="active"{/if}><a href="{:url('/admin/category/index')}">全部</a></li>
|
||||||
{volist name="model_list" id="item"}
|
{volist name="model_list" id="item"}
|
||||||
<li {if $item['id'] == $module_id}class="active"{/if}>
|
<li {if $item['id'] == $model_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('model_id'=>$item['id']))}">{$item['title']}</a>
|
||||||
</li>
|
</li>
|
||||||
{/volist}
|
{/volist}
|
||||||
</ul>
|
</ul>
|
||||||
@@ -47,7 +47,7 @@
|
|||||||
<td>
|
<td>
|
||||||
{$list['level_show']|raw}
|
{$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 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'])}">
|
<a class="add-sub-cate" title="添加子分类" href="{:url('/admin/category/add', ['pid' =>$list['id']])}">
|
||||||
<i class="fa fa-plus-square"></i>
|
<i class="fa fa-plus-square"></i>
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
@@ -75,8 +75,8 @@
|
|||||||
<a href="{:url('/admin/category/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}
|
{/if}
|
||||||
<a title="删除" href="{:url('/admin/category/remove', ['id' => $list['id']])}" class="confirm ajax-get">删除</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', ['from' => $list['id'], 'type'=>'move'])}">移动</a>
|
||||||
<a title="合并" href="{:url('/admin/category/operate', ['id' => $list['id'], 'type'=>'merge'])}">合并</a>
|
<a title="合并" href="{:url('/admin/category/operate', ['from' => $list['id'], 'type'=>'merge'])}">合并</a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{/volist}
|
{/volist}
|
||||||
|
|||||||
@@ -7,8 +7,8 @@
|
|||||||
<h2>{$meta_title}</h2>
|
<h2>{$meta_title}</h2>
|
||||||
</div>
|
</div>
|
||||||
<div class="pull-right">
|
<div class="pull-right">
|
||||||
<a class="btn btn-success" href="{:url('Model/add')}">新 增</a>
|
<a class="btn btn-success" href="{:url('/admin/model/add')}">新 增</a>
|
||||||
<button class="btn ajax-post" target-form="ids" url="{:url('Model/status',array('status'=>0))}">禁 用</button>
|
<button class="btn ajax-post" target-form="ids" url="{:url('/admin/model/status', ['status'=>0])}">禁 用</button>
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
<div class="main-box-body clearfix">
|
<div class="main-box-body clearfix">
|
||||||
@@ -32,7 +32,7 @@
|
|||||||
{volist name="list" id="item"}
|
{volist name="list" id="item"}
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<input class="ids" type="checkbox" name="ids[]" value="{$item['id']}" />
|
<input class="ids" type="checkbox" name="id[]" value="{$item['id']}" />
|
||||||
</td>
|
</td>
|
||||||
<td>{$item['id']}</td>
|
<td>{$item['id']}</td>
|
||||||
<td><i class="fa fa-{$item['icon']}"></i> {$item['name']}</td>
|
<td><i class="fa fa-{$item['icon']}"></i> {$item['name']}</td>
|
||||||
@@ -51,7 +51,7 @@
|
|||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<a href="{:url('admin/attribute/index?model_id='.$item['id'])}">字段</a>
|
<a href="{:url('admin/attribute/index?model_id='.$item['id'])}">字段</a>
|
||||||
<a href="{:url('model/status?id='.$item['id'].'&status='.abs(1-$item['status']))}" class="ajax-get">{$item['status']|show_status_op}</a>
|
<a href="{:url('model/status?id='.$item['id'].'&status='.abs(1-$item['status']))}" class="ajax-get">{$item['status'] ? '禁用' : '启用'}</a>
|
||||||
<a href="{:url('model/edit?id='.$item['id'])}">编辑</a>
|
<a href="{:url('model/edit?id='.$item['id'])}">编辑</a>
|
||||||
<a href="{:url('model/del?id='.$item['id'])}" class="confirm ajax-get">删除</a>
|
<a href="{:url('model/del?id='.$item['id'])}" class="confirm ajax-get">删除</a>
|
||||||
<a href="{:url('admin/content/index?model_id='.$item['id'])}">数据</a>
|
<a href="{:url('admin/content/index?model_id='.$item['id'])}">数据</a>
|
||||||
|
|||||||
Reference in New Issue
Block a user