diff --git a/app/admin/controller/Api.php b/app/admin/controller/Api.php index 43b4936..3a43f2c 100644 --- a/app/admin/controller/Api.php +++ b/app/admin/controller/Api.php @@ -289,65 +289,7 @@ class Api extends BaseController $param=get_params(); $log = new AdminLog(); $content = $log->get_log_list($param); - return table_assign(0,'',$content); - } - - - //回复咨询 - public function set_reply() - { - $param=get_params(); - $data = []; - if(isset($param['cid']) && $param['cid']){ - $data['cid'] = $param['cid']; - $data['uid'] = 0; - $data['create_time'] =time(); - $data['content'] = $param['content']; - $res = Db::name('ConsultationReply')->strict(false)->field(true)->insertGetId($data); - } - if(isset($param['rid']) && $param['rid']){ - $data['id'] = $param['rid']; - $data['update_time'] =time(); - if(isset($param['status']) && $param['status']){ - $data['status'] = $param['status']; - } - else{ - $data['content'] = $param['content']; - } - $res = Db::name('ConsultationReply')->strict(false)->field(true)->update($data); - } - if($res){ - return to_assign(); - } - else{ - return to_assign(0,'操作失败,请重试'); - } - - } - - //评论动态 - public function set_comment() - { - $param=get_params(); - $data = []; - if(isset($param['rid']) && $param['rid']){ - $data['id'] = $param['rid']; - $data['update_time'] =time(); - if(isset($param['status']) && $param['status']){ - $data['status'] = $param['status']; - } - else{ - $data['content'] = $param['content']; - } - $res = Db::name('DynamicComment')->strict(false)->field(true)->update($data); - } - if($res){ - return to_assign(); - } - else{ - return to_assign(0,'操作失败,请重试'); - } - + return table_assign(1,'',$content); } } diff --git a/app/admin/controller/Database.php b/app/admin/controller/Database.php index 6d51de6..660a335 100644 --- a/app/admin/controller/Database.php +++ b/app/admin/controller/Database.php @@ -52,6 +52,7 @@ class Database extends BaseController foreach ($tables as $table) { $this->db->setFile()->backup($table, 0); } + add_log('add'); return to_assign(1, '备份成功!'); } else { return to_assign(0, '请选择要备份的表!'); @@ -66,6 +67,7 @@ class Database extends BaseController } $tables = explode(',',$tables); if ($this->db->optimize($tables)) { + add_log('edit'); return to_assign(1, '数据表优化成功!'); } else { return to_assign(0, '数据表优化出错请重试!'); @@ -80,6 +82,7 @@ class Database extends BaseController } $tables = explode(',',$tables); if ($this->db->repair($tables)) { + add_log('edit'); return to_assign(1, '数据表修复成功!'); } else { return to_assign(0, '数据表修复出错请重试!'); @@ -111,6 +114,7 @@ class Database extends BaseController { $list = $this->db->getFile('timeverif', $id); $this->db->setFile($list)->import(1); + add_log('save'); return to_assign(1,'还原成功!'); } @@ -155,9 +159,11 @@ class Database extends BaseController foreach ($idArr as $k => $v) { $this->db->delFile($v); } + add_log('delete'); return to_assign(1,"删除成功!"); } if ($this->db->delFile($id)) { + add_log('delete'); return to_assign(1,"删除成功!"); } else { return to_assign(0, "备份文件删除失败,请检查文件权限!"); diff --git a/app/admin/controller/User.php b/app/admin/controller/User.php index 884e12d..e5e3080 100644 --- a/app/admin/controller/User.php +++ b/app/admin/controller/User.php @@ -134,4 +134,41 @@ class User extends BaseController } } + public function record() + { + if (request()->isAjax()) { + $param = get_params(); + $where = array(); + if (!empty($param['keywords'])) { + $where[] = ['nickname|title','like', '%' . $param['keywords'] . '%']; + } + $rows = empty($param['limit']) ? get_config(app . page_size) : $param['limit']; + $content = DB::name('user_log') + ->field("id,uid,nickname,title,content,ip,param,create_time") + ->order('create_time desc') + ->where($where) + ->paginate($rows, false, ['query' => $param]); + + $content->toArray(); + foreach ($content as $k => $v) { + $data = $v; + $param_array = json_decode($v['param'], true); + $name = ''; + if (!empty($param_array['name'])) { + $name = ':'. $param_array['name']; + } + if (!empty($param_array['title'])) { + $name = ':'. $param_array['title']; + } + $data['content'] = $v['content'] . $name; + $data['times'] = time_trans($v['create_time']); + $content->offsetSet($k, $data); + } + return table_assign(1, '', $content); + } + else{ + return view(); + } + } + } diff --git a/app/admin/view/admin/log.html b/app/admin/view/admin/log.html index 0ece41b..a030b25 100644 --- a/app/admin/view/admin/log.html +++ b/app/admin/view/admin/log.html @@ -45,10 +45,9 @@ align: 'center', width: 90 }, { - field: 'admin_menu', + field: 'title', title: '操作类型', - width: 90, - align: 'center', + width: 150 }, { field: 'content', title: '操作描述', diff --git a/app/admin/view/admin/log_list.html b/app/admin/view/admin/log_list.html index 8d2b6ca..c1a2032 100644 --- a/app/admin/view/admin/log_list.html +++ b/app/admin/view/admin/log_list.html @@ -36,7 +36,7 @@ limit: limit }, success: function(e) { - if (e.code == 0) { + if (e.code == 1) { var html = ''; if(e.data.length>0){ page++; diff --git a/app/admin/view/index/main.html b/app/admin/view/index/main.html index e3f8731..d2cbfb5 100644 --- a/app/admin/view/index/main.html +++ b/app/admin/view/index/main.html @@ -222,7 +222,7 @@ limit: 10 }, success: function (e) { - if (e.code == 0) { + if (e.code == 1) { var html = ''; $.each(e.data, function (key, value) { html += '
勾股CMS是一套基于ThinkPHP6 + Layui + MySql打造的轻量级、高性能快速建站的内容管理系统。
\";}', 1, 1612521657, 1619088538); -INSERT INTO `cms_config` VALUES (3, '微信配置', 'wechat', 'a:9:{s:2:\"id\";s:1:\"3\";s:5:\"token\";s:8:\"GOUGUCMS\";s:14:\"login_back_url\";s:48:\"http://www.gougucms.com/wechat/index/getChatInfo\";s:5:\"appid\";s:18:\"wxdf96xxxx7cd6f0c5\";s:9:\"appsecret\";s:32:\"1dbf319a4f0dfed7xxxxfd1c7dbba488\";s:5:\"mchid\";s:10:\"151xxxx331\";s:11:\"secrect_key\";s:32:\"beiyuexxxxhunangdmabcxxxxjixxxng\";s:8:\"cert_url\";s:13:\"/extend/cert/\";s:12:\"pay_back_url\";s:42:\"https://www.gouguapp.com/wxappv1/wx/notify\";}', 1, 1612522314, 1613789058); -INSERT INTO `cms_config` VALUES (4, '其他配置', 'other', 'a:3:{s:2:\"id\";s:1:\"4\";s:6:\"author\";s:12:\"629工作室\";s:7:\"version\";s:5:\"1.0.2\";}', 1, 1613725791, 1613789431); +INSERT INTO `cms_config` VALUES (3, '微信配置', 'wechat', 'a:9:{s:2:\"id\";s:1:\"3\";s:5:\"token\";s:8:\"GOUGUCMS\";s:14:\"login_back_url\";s:48:\"http://www.gougucms.com/wechat/index/getChatInfo\";s:5:\"appid\";s:18:\"wxdf96xxxx7cd6f0c5\";s:9:\"appsecret\";s:32:\"1dbf319a4f0dfed7xxxxfd1c7dbba488\";s:5:\"mchid\";s:10:\"151xxxx331\";s:11:\"secrect_key\";s:32:\"beiyuexxxxhunangdmabcxxxxjixxxng\";s:8:\"cert_url\";s:13:\"/extend/cert/\";s:12:\"pay_back_url\";s:42:\"https://www.gougucms.com/wechat/index/notify\";}', 1, 1612522314, 1613789058); +INSERT INTO `cms_config` VALUES (4, '其他配置', 'other', 'a:3:{s:2:\"id\";s:1:\"4\";s:6:\"author\";s:12:\"勾股工作室\";s:7:\"version\";s:5:\"1.0.2\";}', 1, 1613725791, 1613789431); -- ---------------------------- @@ -268,7 +267,7 @@ CREATE TABLE `cms_keywords` ( `create_time` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间', `update_time` int(11) NOT NULL DEFAULT '0' COMMENT '更新时间', PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARACTER SET = utf8mb4 COMMENT='关键字'; +) ENGINE=InnoDB DEFAULT CHARACTER SET = utf8mb4 COMMENT='关键字表'; -- ---------------------------- -- Records of cms_keywords -- ---------------------------- @@ -288,7 +287,7 @@ CREATE TABLE `cms_article_cate` ( `create_time` int(11) NOT NULL DEFAULT '0' COMMENT '添加时间', `update_time` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间', PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARACTER SET = utf8mb4 COMMENT='内容分类'; +) ENGINE=InnoDB DEFAULT CHARACTER SET = utf8mb4 COMMENT='内容分类表'; -- ---------------------------- -- Records of cms_article_cate -- ---------------------------- @@ -317,7 +316,7 @@ CREATE TABLE `cms_article` ( `update_time` int(11) NOT NULL DEFAULT '0', `delete_time` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARACTER SET = utf8mb4 COMMENT='文章'; +) ENGINE=InnoDB DEFAULT CHARACTER SET = utf8mb4 COMMENT='文章表'; -- ---------------------------- -- Records of cms_article @@ -337,7 +336,7 @@ CREATE TABLE `cms_article_keywords` ( PRIMARY KEY (`id`), KEY `aid` (`aid`), KEY `inid` (`keywords_id`) -) ENGINE=InnoDB DEFAULT CHARACTER SET = utf8mb4 COMMENT='文章关联关键字'; +) ENGINE=InnoDB DEFAULT CHARACTER SET = utf8mb4 COMMENT='文章关联表'; -- ---------------------------- -- Records of cms_article_keywords -- ---------------------------- @@ -355,7 +354,7 @@ CREATE TABLE `cms_sitemap_cate` ( `create_time` int(11) NOT NULL DEFAULT 0, `update_time` int(11) NOT NULL DEFAULT 0, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARACTER SET = utf8mb4 COMMENT = '网站地图分类'; +) ENGINE=InnoDB DEFAULT CHARACTER SET = utf8mb4 COMMENT = '网站地图分类表'; -- ---------------------------- -- Table structure for cms_sitemap @@ -374,7 +373,7 @@ CREATE TABLE `cms_sitemap` ( `create_time` int(11) NOT NULL DEFAULT 0, `update_time` int(11) NOT NULL DEFAULT 0, PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARACTER SET = utf8mb4 COMMENT = '网站地图内容'; +) ENGINE=InnoDB DEFAULT CHARACTER SET = utf8mb4 COMMENT = '网站地图内容表'; -- ---------------------------- @@ -414,16 +413,17 @@ CREATE TABLE `cms_nav_info` ( `create_time` int(11) NOT NULL DEFAULT '0', `update_time` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARACTER SET = utf8mb4 COMMENT='导航详情'; +) ENGINE=InnoDB DEFAULT CHARACTER SET = utf8mb4 COMMENT='导航详情表'; -- ----------------------------- -- Records of `cms_nav_info` -- ----------------------------- INSERT INTO `cms_nav_info` VALUES ('1', '0', '1', '首页', '/', '', '0', '1', '1', '0', '0'); INSERT INTO `cms_nav_info` VALUES ('2', '0', '1', '文档', '/', '', '0', '1', '2', '0', '0'); -INSERT INTO `cms_nav_info` VALUES ('3', '0', '1', '后台演示', '/admin/index/index.html', '', '1', '1', '4', '0', '0'); -INSERT INTO `cms_nav_info` VALUES ('4', '0', '1', '社区', '/', '', '0', '1', '3', '0', '0'); +INSERT INTO `cms_nav_info` VALUES ('3', '0', '1', '社区', '/', '', '1', '1', '3', '0', '0'); +INSERT INTO `cms_nav_info` VALUES ('4', '0', '1', '腾讯云优惠', 'https://curl.qcloud.com/PPEgI0oV', '', '1', '1', '4', '0', '0'); INSERT INTO `cms_nav_info` VALUES ('5', '0', '1', '阿里云特惠', 'https://www.aliyun.com/activity/daily/bestoffer?userCode=dmrcx154', '', '1', '1', '5', '0', '0'); +INSERT INTO `cms_nav_info` VALUES ('6', '0', '1', '后台演示', 'https://cms.gougucms.com/admin/index/index.html', '', '1', '1', '6', '0', '0'); -- ---------------------------- -- Table structure for `cms_slide` @@ -438,7 +438,7 @@ CREATE TABLE `cms_slide` ( `create_time` int(11) NOT NULL DEFAULT '0', `update_time` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARACTER SET = utf8mb4 COMMENT='幻灯片'; +) ENGINE=InnoDB DEFAULT CHARACTER SET = utf8mb4 COMMENT='幻灯片表'; -- ---------------------------- -- Records of cms_slide @@ -461,7 +461,7 @@ CREATE TABLE `cms_slide_info` ( `create_time` int(11) NOT NULL DEFAULT '0', `update_time` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARACTER SET = utf8mb4 COMMENT='幻灯片详情'; +) ENGINE=InnoDB DEFAULT CHARACTER SET = utf8mb4 COMMENT='幻灯片详情表'; -- ---------------------------- -- Records of cms_slide_info