修复发现的bug
This commit is contained in:
parent
e6a07b68c0
commit
8df8d2689a
@ -188,38 +188,6 @@ function get_article_cate()
|
||||
return $cate;
|
||||
}
|
||||
|
||||
//读取指定分类下的文章列表
|
||||
function get_article($cate_id = "")
|
||||
{
|
||||
$where = array();
|
||||
if (!empty($cate_id)) {
|
||||
$where['article_cate_id'] = $cate_id;
|
||||
}
|
||||
$article = \think\facade\Db::name('article')->where($where)->order('create_time desc')->paginate( get_config(app . page_size))->toArray();
|
||||
return $article;
|
||||
}
|
||||
|
||||
//读取指定文章的详情
|
||||
function get_article_info($id)
|
||||
{
|
||||
$article = \think\facade\Db::name('article')->where(['id' => $id])->find();
|
||||
if (empty($article)) {
|
||||
return $this->error('文章不存在');
|
||||
}
|
||||
$keywrod_array = \think\facade\Db::name('ArticleKeywords')
|
||||
->field('i.aid,i.keywords_id,k.title')
|
||||
->alias('i')
|
||||
->join('keywords k', 'k.id = i.keywords_id', 'LEFT')
|
||||
->order('i.create_time asc')
|
||||
->where(array('i.aid' => $id, 'k.status' => 1))
|
||||
->select()->toArray();
|
||||
|
||||
$article['keyword_ids'] = implode(",", array_column($keywrod_array, 'keywords_id'));
|
||||
$article['keyword_names'] = implode(',', array_column($keywrod_array, 'title'));
|
||||
return $article;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 管理员操作日志
|
||||
* @param string $type 操作类型 login add edit view delete
|
||||
|
@ -125,7 +125,7 @@ class Article extends BaseController
|
||||
$id = empty(get_params('id')) ? 0 : get_params('id');
|
||||
View::assign('id', $id);
|
||||
if ($id > 0) {
|
||||
$article = get_article_info($id);
|
||||
$article = (new ArticleList())->detail($id);
|
||||
View::assign('article', $article);
|
||||
return view('edit');
|
||||
}
|
||||
|
@ -49,10 +49,6 @@ class Auth
|
||||
protected function checkAuth($controller, $pathInfo, $action, $uid)
|
||||
{
|
||||
//Cache::delete('RulesSrc' . $uid);
|
||||
if ($uid == 1) {
|
||||
// id=1的管理员默认拥有所有权限
|
||||
return true;
|
||||
} else {
|
||||
if (!Cache::get('RulesSrc' . $uid) || !Cache::get('RulesSrc0')) {
|
||||
//用户所在权限组及所拥有的权限
|
||||
// 执行查询
|
||||
@ -89,14 +85,13 @@ class Auth
|
||||
$auth_list_all = Cache::get('RulesSrc0');
|
||||
$auth_list = Cache::get('RulesSrc' . $uid);
|
||||
}
|
||||
if (!in_array((string) $controller . '/' . $pathInfo, $auth_list_all)) {
|
||||
return true;
|
||||
}
|
||||
else{
|
||||
if (!in_array((string) $controller . '/' . $pathInfo, $auth_list)) {
|
||||
|
||||
$pathUrl = $controller . '/' . $pathInfo;
|
||||
if (!in_array($pathUrl , $auth_list) && !in_array($pathUrl, $auth_list_all)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3,5 +3,23 @@ namespace app\admin\model;
|
||||
use think\Model;
|
||||
class Article extends Model
|
||||
{
|
||||
|
||||
// 获取文章详情
|
||||
public function detail($id)
|
||||
{
|
||||
$article = \think\facade\Db::name('article')->where(['id' => $id])->find();
|
||||
if (empty($article)) {
|
||||
return $this->error('文章不存在');
|
||||
}
|
||||
$keywrod_array = \think\facade\Db::name('ArticleKeywords')
|
||||
->field('i.aid,i.keywords_id,k.title')
|
||||
->alias('i')
|
||||
->join('keywords k', 'k.id = i.keywords_id', 'LEFT')
|
||||
->order('i.create_time asc')
|
||||
->where(array('i.aid' => $id, 'k.status' => 1))
|
||||
->select()->toArray();
|
||||
|
||||
$article['keyword_ids'] = implode(",", array_column($keywrod_array, 'keywords_id'));
|
||||
$article['keyword_names'] = implode(',', array_column($keywrod_array, 'title'));
|
||||
return $article;
|
||||
}
|
||||
}
|
@ -110,7 +110,7 @@
|
||||
return;
|
||||
}
|
||||
if (obj.event === 'del') {
|
||||
layer.confirm('您确定要删除该员工', {
|
||||
layer.confirm('您确定要删除该账户', {
|
||||
icon: 3,
|
||||
title: '提示'
|
||||
}, function (index) {
|
||||
|
@ -96,7 +96,7 @@ INSERT INTO `cms_admin_menu` VALUES (8, 1, '权限角色', 'admin/role/index', '
|
||||
INSERT INTO `cms_admin_menu` VALUES (9, 1, '管 理 员', 'admin/admin/index', '', 1, 0, 0);
|
||||
INSERT INTO `cms_admin_menu` VALUES (10, 1, '操作日志', 'admin/admin/log', '', 1, 0, 0);
|
||||
INSERT INTO `cms_admin_menu` VALUES (11, 1, '数据备份', 'admin/database/database', '', 1, 0, 0);
|
||||
INSERT INTO `cms_admin_menu` VALUES (12, 1, '数据还原', 'admin/database/backupList', '', 1, 0, 0);
|
||||
INSERT INTO `cms_admin_menu` VALUES (12, 1, '数据还原', 'admin/database/backuplist', '', 1, 0, 0);
|
||||
INSERT INTO `cms_admin_menu` VALUES (13, 2, '导航设置', 'admin/nav/index', '', 1, 0, 0);
|
||||
INSERT INTO `cms_admin_menu` VALUES (14, 2, '网站地图', 'admin/sitemap/index', '', 1, 0, 0);
|
||||
INSERT INTO `cms_admin_menu` VALUES (15, 2, '轮播广告', 'admin/slide/index', '', 1, 0, 0);
|
||||
@ -199,7 +199,7 @@ INSERT INTO `cms_admin_rule` VALUES (71, 70, 'admin/search/get_list', '关键字
|
||||
INSERT INTO `cms_admin_rule` VALUES (72, 70, 'admin/search/delete', '关键字搜索删除', 0, 0);
|
||||
INSERT INTO `cms_admin_rule` VALUES (73, 3, 'admin/user/index', '用户管理', 0, 0);
|
||||
INSERT INTO `cms_admin_rule` VALUES (74, 73, 'admin/user/get_list', '用户管理列表', 0, 0);
|
||||
INSERT INTO `cms_admin_rule` VALUES (75, 73, 'admin/user/add', '修改用户', 0, 0);
|
||||
INSERT INTO `cms_admin_rule` VALUES (75, 73, 'admin/user/edit', '修改用户信息', 0, 0);
|
||||
INSERT INTO `cms_admin_rule` VALUES (76, 73, 'admin/user/post_submit', '用户保存', 0, 0);
|
||||
INSERT INTO `cms_admin_rule` VALUES (77, 73, 'admin/user/view', '用户查看', 0, 0);
|
||||
INSERT INTO `cms_admin_rule` VALUES (78, 73, 'admin/user/delete', '用户禁用',0, 0);
|
||||
@ -219,9 +219,9 @@ INSERT INTO `cms_admin_rule` VALUES (91, 1, 'admin/database/database', '数据
|
||||
INSERT INTO `cms_admin_rule` VALUES (92, 91, 'admin/database/backup', '数据表备份', 0, 0);
|
||||
INSERT INTO `cms_admin_rule` VALUES (93, 91, 'admin/database/optimize', '数据表优化', 0, 0);
|
||||
INSERT INTO `cms_admin_rule` VALUES (94, 91, 'admin/database/repair', '数据表修复', 0, 0);
|
||||
INSERT INTO `cms_admin_rule` VALUES (95, 1, 'admin/database/backupList', '数据还原', 0, 0);
|
||||
INSERT INTO `cms_admin_rule` VALUES (95, 1, 'admin/database/backuplist', '数据还原', 0, 0);
|
||||
INSERT INTO `cms_admin_rule` VALUES (96, 95, 'admin/database/import', '数据表还原', 0, 0);
|
||||
INSERT INTO `cms_admin_rule` VALUES (97, 95, 'admin/database/downFile', '备份数据下载', 0, 0);
|
||||
INSERT INTO `cms_admin_rule` VALUES (97, 95, 'admin/database/downfile', '备份数据下载', 0, 0);
|
||||
INSERT INTO `cms_admin_rule` VALUES (98, 95, 'admin/database/del', '删除备份数据', 0, 0);
|
||||
-- ----------------------------
|
||||
-- Table structure for `cms_admin_log`
|
||||
|
Loading…
x
Reference in New Issue
Block a user