选择tag控件优化
This commit is contained in:
parent
c3f8bbc9c9
commit
88a65167e5
@ -96,7 +96,7 @@ class Api extends BaseController
|
|||||||
$group = get_admin_group_info(get_params('id'))['rules'];
|
$group = get_admin_group_info(get_params('id'))['rules'];
|
||||||
}
|
}
|
||||||
$list = create_tree_list(0, $rule, $group);
|
$list = create_tree_list(0, $rule, $group);
|
||||||
return to_assign(0, '', $list);
|
return to_assign(1, '', $list);
|
||||||
}
|
}
|
||||||
|
|
||||||
//获取菜单树列表
|
//获取菜单树列表
|
||||||
@ -108,14 +108,14 @@ class Api extends BaseController
|
|||||||
$group = get_admin_group_info(get_params('id'))['menus'];
|
$group = get_admin_group_info(get_params('id'))['menus'];
|
||||||
}
|
}
|
||||||
$list = create_tree_list(0, $rule, $group);
|
$list = create_tree_list(0, $rule, $group);
|
||||||
return to_assign(0, '', $list);
|
return to_assign(1, '', $list);
|
||||||
}
|
}
|
||||||
|
|
||||||
//获取关键字
|
//获取关键字
|
||||||
public function get_keyword_cate()
|
public function get_keyword_cate()
|
||||||
{
|
{
|
||||||
$keyword = get_keywords();
|
$keyword = get_keywords();
|
||||||
return to_assign(0, '', $keyword);
|
return to_assign(1, '', $keyword);
|
||||||
}
|
}
|
||||||
|
|
||||||
//清空缓存
|
//清空缓存
|
||||||
|
@ -48,7 +48,10 @@ class Article extends BaseController
|
|||||||
$data['id'] = $param['id'];
|
$data['id'] = $param['id'];
|
||||||
$data['update_time'] = time();
|
$data['update_time'] = time();
|
||||||
$res = ArticleCate::strict(false)->field(true)->update($data);
|
$res = ArticleCate::strict(false)->field(true)->update($data);
|
||||||
if($res) add_log('edit',$data['id'],$data);
|
if ($res) {
|
||||||
|
add_log('edit', $data['id'], $data);
|
||||||
|
}
|
||||||
|
|
||||||
return to_assign();
|
return to_assign();
|
||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
@ -59,7 +62,10 @@ class Article extends BaseController
|
|||||||
}
|
}
|
||||||
$param['create_time'] = time();
|
$param['create_time'] = time();
|
||||||
$insertId = ArticleCate::strict(false)->field(true)->insertGetId($param);
|
$insertId = ArticleCate::strict(false)->field(true)->insertGetId($param);
|
||||||
if($insertId) add_log('add',$insertId,$param);
|
if ($insertId) {
|
||||||
|
add_log('add', $insertId, $param);
|
||||||
|
}
|
||||||
|
|
||||||
return to_assign();
|
return to_assign();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -78,7 +84,7 @@ class Article extends BaseController
|
|||||||
return to_assign(0, "该分类下还有文章,无法删除");
|
return to_assign(0, "该分类下还有文章,无法删除");
|
||||||
}
|
}
|
||||||
if (Db::name('ArticleCate')->delete($id) !== false) {
|
if (Db::name('ArticleCate')->delete($id) !== false) {
|
||||||
add_log('delete',$id);
|
add_log('delete', $id);
|
||||||
return to_assign(1, "删除分类成功");
|
return to_assign(1, "删除分类成功");
|
||||||
} else {
|
} else {
|
||||||
return to_assign(0, "删除失败");
|
return to_assign(0, "删除失败");
|
||||||
@ -96,10 +102,10 @@ class Article extends BaseController
|
|||||||
$param = get_params();
|
$param = get_params();
|
||||||
$where = array();
|
$where = array();
|
||||||
if (!empty($param['keywords'])) {
|
if (!empty($param['keywords'])) {
|
||||||
$where[] = ['a.id|a.title|a.keywords|a.desc|a.content|w.title','like', '%' . $param['keywords'] . '%'];
|
$where[] = ['a.id|a.title|a.keywords|a.desc|a.content|w.title', 'like', '%' . $param['keywords'] . '%'];
|
||||||
}
|
}
|
||||||
if (!empty($param['article_cate_id'])) {
|
if (!empty($param['article_cate_id'])) {
|
||||||
$where[] =['a.article_cate_id','=', $param['article_cate_id']];
|
$where[] = ['a.article_cate_id', '=', $param['article_cate_id']];
|
||||||
}
|
}
|
||||||
$where[] = ['a.status', '>=', 0];
|
$where[] = ['a.status', '>=', 0];
|
||||||
$rows = empty($param['limit']) ? get_config(app . page_size) : $param['limit'];
|
$rows = empty($param['limit']) ? get_config(app . page_size) : $param['limit'];
|
||||||
@ -121,7 +127,7 @@ class Article extends BaseController
|
|||||||
$article = get_article_info($id);
|
$article = get_article_info($id);
|
||||||
View::assign('article', $article);
|
View::assign('article', $article);
|
||||||
return view('edit');
|
return view('edit');
|
||||||
}
|
}
|
||||||
return view();
|
return view();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -139,7 +145,10 @@ class Article extends BaseController
|
|||||||
}
|
}
|
||||||
$param['update_time'] = time();
|
$param['update_time'] = time();
|
||||||
$res = ArticleList::strict(false)->field(true)->update($param);
|
$res = ArticleList::strict(false)->field(true)->update($param);
|
||||||
if($res) add_log('edit',$param['id'],$param);
|
if ($res) {
|
||||||
|
add_log('edit', $param['id'], $param);
|
||||||
|
}
|
||||||
|
|
||||||
return to_assign();
|
return to_assign();
|
||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
@ -148,32 +157,37 @@ class Article extends BaseController
|
|||||||
// 验证失败 输出错误信息
|
// 验证失败 输出错误信息
|
||||||
return to_assign(0, $e->getError());
|
return to_assign(0, $e->getError());
|
||||||
}
|
}
|
||||||
Db::startTrans();
|
|
||||||
$param['create_time'] = time();
|
$param['create_time'] = time();
|
||||||
$aid = ArticleList::strict(false)->field(true)->insertGetId($param);
|
Db::startTrans();
|
||||||
if ($aid) {
|
try {
|
||||||
if (isset($param['keyword_names']) && $param['keyword_names']) {
|
$aid = ArticleList::strict(false)->field(true)->insertGetId($param);
|
||||||
$uidArray = explode(',', $param['keyword_names']);
|
if ($aid) {
|
||||||
foreach ($uidArray as $key => $value) {
|
if (isset($param['keyword_names']) && $param['keyword_names']) {
|
||||||
if (!$value) {
|
$uidArray = explode(',', $param['keyword_names']);
|
||||||
continue;
|
foreach ($uidArray as $key => $value) {
|
||||||
|
if (!$value) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
$data = [];
|
||||||
|
$data['aid'] = $aid;
|
||||||
|
$newKeyword['title'] = $value;
|
||||||
|
$keywords_id = Db::name('Keywords')->insertGetId($newKeyword);
|
||||||
|
$data['keywords_id'] = $keywords_id;
|
||||||
|
$data['create_time'] = time();
|
||||||
|
Db::name('ArticleKeywords')->strict(false)->field(true)->insertGetId($data);
|
||||||
}
|
}
|
||||||
|
|
||||||
$data = [];
|
|
||||||
$data['aid'] = $aid;
|
|
||||||
$newKeyword['title'] = $value;
|
|
||||||
$keywords_id = Db::name('Keywords')->insertGetId($newKeyword);
|
|
||||||
$data['keywords_id'] = $keywords_id;
|
|
||||||
$data['create_time'] = time();
|
|
||||||
Db::name('ArticleKeywords')->strict(false)->field(true)->insertGetId($data);
|
|
||||||
}
|
}
|
||||||
|
if ($aid) {
|
||||||
|
add_log('add', $aid, $param);
|
||||||
|
}
|
||||||
|
Db::commit();
|
||||||
|
return to_assign();
|
||||||
|
} else {
|
||||||
|
return to_assign(0, '添加失败');
|
||||||
}
|
}
|
||||||
if($aid) add_log('add',$aid,$param);
|
}
|
||||||
Db::commit();
|
catch (\Exception $e) { ##这里参数不能删除($e:错误信息)
|
||||||
return to_assign();
|
Db::rollback();
|
||||||
} else {
|
|
||||||
Db::rollback();
|
|
||||||
return to_assign(0, '添加失败');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -34,7 +34,7 @@ layui.define(['layer'],function(exports){
|
|||||||
type:'post',
|
type:'post',
|
||||||
data:me.settings.where,
|
data:me.settings.where,
|
||||||
success:function(e){
|
success:function(e){
|
||||||
if(e.code==0){
|
if(e.code==1){
|
||||||
if(e.data.length>0){
|
if(e.data.length>0){
|
||||||
me.ajaxData=e.data;
|
me.ajaxData=e.data;
|
||||||
layer.open({
|
layer.open({
|
||||||
|
@ -56,7 +56,7 @@ select{padding:4px 5px;border:1px solid #cbcbcb; border-radius:2px; margin-right
|
|||||||
/*a*/
|
/*a*/
|
||||||
a {color:#323232; text-decoration:none;}
|
a {color:#323232; text-decoration:none;}
|
||||||
a:visited {text-decoration:none;}
|
a:visited {text-decoration:none;}
|
||||||
a:hover {color:#4385F5;}
|
a:hover {color:#4385F5; transition: all 0.5s;}
|
||||||
a:active {color:#4385F5;}
|
a:active {color:#4385F5;}
|
||||||
|
|
||||||
/*省略行数*/
|
/*省略行数*/
|
||||||
@ -80,15 +80,15 @@ a:active {color:#4385F5;}
|
|||||||
|
|
||||||
.nav-menu{font-size:16px;}
|
.nav-menu{font-size:16px;}
|
||||||
.nav-menu li{height:60px; float:left; color:#fff;}
|
.nav-menu li{height:60px; float:left; color:#fff;}
|
||||||
.nav-menu li a.nav-a{height:60px; min-width:36px; text-align:center; line-height:60px; padding:0 25px; display:inline-block; color:#323232;}
|
.nav-menu li a.nav-a{height:60px; min-width:36px; text-align:center; line-height:60px; padding:0 25px; display:inline-block; color:#323232;transition: all 0.6s ;}
|
||||||
.nav-menu li a.nav-a:hover{color:#4385F5}
|
.nav-menu li a.nav-a:hover{color:#4385F5; transition: all 0.6s;}
|
||||||
.nav-menu li.on a.nav-a{color:#4385F5}
|
.nav-menu li.on a.nav-a{color:#4385F5}
|
||||||
|
|
||||||
.nav-menu li.nav-login{position:relative; padding-left:25px}
|
.nav-menu li.nav-login{position:relative; padding-left:25px}
|
||||||
.nav-menu li.nav-login a.nav-a{padding:0 2px; margin:0 5px}
|
.nav-menu li.nav-login a.nav-a{padding:0 2px; margin:0 5px}
|
||||||
.nav-menu li.nav-login span{padding:5px 16px 6px; border-radius:3px; font-size:14px; background-color:#EB4336; color:#fff}
|
.nav-menu li.nav-login span{padding:5px 16px 6px; border-radius:3px; font-size:14px; background-color:#EB4336; color:#fff}
|
||||||
.nav-menu li.nav-login span.login-span{background-color: #4385F5;}
|
.nav-menu li.nav-login span.login-span{background-color: #4385F5;}
|
||||||
.nav-menu li.nav-login a:hover span{opacity:0.9}
|
.nav-menu li.nav-login a:hover span{opacity:0.8;transition: all 0.5s;}
|
||||||
|
|
||||||
.nav-login-box{width:320px; border-radius:2px; position:absolute; top:60px; right:0; background-color:#fff; z-index:-1; color:#333; font-size:14px;-webkit-transform:scale(0.5);transform:scale(0.5);-webkit-transition:.2s;transition:.2s;opacity:0;-webkit-transform-origin:center top;transform-origin:center top;-webkit-box-shadow:0 15px 30px rgba(0,0,0,.2);box-shadow:0 15px 30px rgba(0,0,0,.2);}
|
.nav-login-box{width:320px; border-radius:2px; position:absolute; top:60px; right:0; background-color:#fff; z-index:-1; color:#333; font-size:14px;-webkit-transform:scale(0.5);transform:scale(0.5);-webkit-transition:.2s;transition:.2s;opacity:0;-webkit-transform-origin:center top;transform-origin:center top;-webkit-box-shadow:0 15px 30px rgba(0,0,0,.2);box-shadow:0 15px 30px rgba(0,0,0,.2);}
|
||||||
.login-note{padding: 15px 15px 0; color: #FF5722;}
|
.login-note{padding: 15px 15px 0; color: #FF5722;}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user