diff --git a/application/admin/command/Crud.php b/application/admin/command/Crud.php
index 67036e2a..f4405a47 100755
--- a/application/admin/command/Crud.php
+++ b/application/admin/command/Crud.php
@@ -211,7 +211,7 @@ class Crud extends Command
//关联表
$relation = $input->getOption('relation');
//自定义关联表模型
- $relationModel = $input->getOption('relationmodel');
+ $relationModels = $input->getOption('relationmodel');
//模式
$relationMode = $mode = $input->getOption('relationmode');
//外键
@@ -337,7 +337,7 @@ class Crud extends Command
}
}
$relationTableInfo = $relationTableInfo[0];
- $relationModel = isset($relationModel[$index]) ? $relationModel[$index] : '';
+ $relationModel = isset($relationModels[$index]) ? $relationModels[$index] : '';
list($relationNamespace, $relationName, $relationFile) = $this->getModelData($modelModuleName, $relationModel, $relationName);
@@ -1449,6 +1449,15 @@ EOD;
if ($itemArr) {
$html .= ", searchList: " . $searchList;
}
+
+ // 文件、图片、权重等字段默认不加入搜索栏,字符串类型默认LIKE
+ $noSearchFiles = ['file$', 'files$', 'image$', 'images$', '^weigh$'];
+ if(preg_match("/" . implode('|', $noSearchFiles) . "/i", $field)){
+ $html .= ", operate: false";
+ }else if(in_array($datatype, ['varchar'])) {
+ $html .= ", operate: 'LIKE'";
+ }
+
if (in_array($datatype, ['date', 'datetime']) || $formatter === 'datetime') {
$html .= ", operate:'RANGE', addclass:'datetimerange'";
} elseif (in_array($datatype, ['float', 'double', 'decimal'])) {
diff --git a/application/admin/command/Crud/stubs/html/heading-html.stub b/application/admin/command/Crud/stubs/html/heading-html.stub
index 5cbf3272..9392c802 100644
--- a/application/admin/command/Crud/stubs/html/heading-html.stub
+++ b/application/admin/command/Crud/stubs/html/heading-html.stub
@@ -2,9 +2,9 @@
{:build_heading(null,FALSE)}
diff --git a/application/admin/command/Install/fastadmin.sql b/application/admin/command/Install/fastadmin.sql
index 4ebc431d..42dd5c7d 100755
--- a/application/admin/command/Install/fastadmin.sql
+++ b/application/admin/command/Install/fastadmin.sql
@@ -11,18 +11,18 @@ SET FOREIGN_KEY_CHECKS = 0;
DROP TABLE IF EXISTS `fa_admin`;
CREATE TABLE `fa_admin` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID',
- `username` varchar(20) NOT NULL DEFAULT '' COMMENT '用户名',
- `nickname` varchar(50) NOT NULL DEFAULT '' COMMENT '昵称',
- `password` varchar(32) NOT NULL DEFAULT '' COMMENT '密码',
- `salt` varchar(30) NOT NULL DEFAULT '' COMMENT '密码盐',
- `avatar` varchar(255) NOT NULL DEFAULT '' COMMENT '头像',
- `email` varchar(100) NOT NULL DEFAULT '' COMMENT '电子邮箱',
+ `username` varchar(20) DEFAULT '' COMMENT '用户名',
+ `nickname` varchar(50) DEFAULT '' COMMENT '昵称',
+ `password` varchar(32) DEFAULT '' COMMENT '密码',
+ `salt` varchar(30) DEFAULT '' COMMENT '密码盐',
+ `avatar` varchar(255) DEFAULT '' COMMENT '头像',
+ `email` varchar(100) DEFAULT '' COMMENT '电子邮箱',
`loginfailure` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '失败次数',
`logintime` int(10) DEFAULT NULL COMMENT '登录时间',
`loginip` varchar(50) DEFAULT NULL COMMENT '登录IP',
`createtime` int(10) DEFAULT NULL COMMENT '创建时间',
`updatetime` int(10) DEFAULT NULL COMMENT '更新时间',
- `token` varchar(59) NOT NULL DEFAULT '' COMMENT 'Session标识',
+ `token` varchar(59) DEFAULT '' COMMENT 'Session标识',
`status` varchar(30) NOT NULL DEFAULT 'normal' COMMENT '状态',
PRIMARY KEY (`id`),
UNIQUE KEY `username` (`username`) USING BTREE
@@ -42,12 +42,12 @@ DROP TABLE IF EXISTS `fa_admin_log`;
CREATE TABLE `fa_admin_log` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID',
`admin_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '管理员ID',
- `username` varchar(30) NOT NULL DEFAULT '' COMMENT '管理员名字',
- `url` varchar(1500) NOT NULL DEFAULT '' COMMENT '操作页面',
- `title` varchar(100) NOT NULL DEFAULT '' COMMENT '日志标题',
+ `username` varchar(30) DEFAULT '' COMMENT '管理员名字',
+ `url` varchar(1500) DEFAULT '' COMMENT '操作页面',
+ `title` varchar(100) DEFAULT '' COMMENT '日志标题',
`content` text NOT NULL COMMENT '内容',
- `ip` varchar(50) NOT NULL DEFAULT '' COMMENT 'IP',
- `useragent` varchar(255) NOT NULL DEFAULT '' COMMENT 'User-Agent',
+ `ip` varchar(50) DEFAULT '' COMMENT 'IP',
+ `useragent` varchar(255) DEFAULT '' COMMENT 'User-Agent',
`createtime` int(10) DEFAULT NULL COMMENT '操作时间',
PRIMARY KEY (`id`),
KEY `name` (`username`)
@@ -82,20 +82,20 @@ CREATE TABLE `fa_attachment` (
`id` int(20) unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID',
`admin_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '管理员ID',
`user_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '会员ID',
- `url` varchar(255) NOT NULL DEFAULT '' COMMENT '物理路径',
- `imagewidth` varchar(30) NOT NULL DEFAULT '' COMMENT '宽度',
- `imageheight` varchar(30) NOT NULL DEFAULT '' COMMENT '高度',
- `imagetype` varchar(30) NOT NULL DEFAULT '' COMMENT '图片类型',
+ `url` varchar(255) DEFAULT '' COMMENT '物理路径',
+ `imagewidth` varchar(30) DEFAULT '' COMMENT '宽度',
+ `imageheight` varchar(30) DEFAULT '' COMMENT '高度',
+ `imagetype` varchar(30) DEFAULT '' COMMENT '图片类型',
`imageframes` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '图片帧数',
- `filename` varchar(100) NOT NULL DEFAULT '' COMMENT '文件名称',
+ `filename` varchar(100) DEFAULT '' COMMENT '文件名称',
`filesize` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '文件大小',
- `mimetype` varchar(100) NOT NULL DEFAULT '' COMMENT 'mime类型',
- `extparam` varchar(255) NOT NULL DEFAULT '' COMMENT '透传数据',
+ `mimetype` varchar(100) DEFAULT '' COMMENT 'mime类型',
+ `extparam` varchar(255) DEFAULT '' COMMENT '透传数据',
`createtime` int(10) DEFAULT NULL COMMENT '创建日期',
`updatetime` int(10) DEFAULT NULL COMMENT '更新时间',
`uploadtime` int(10) DEFAULT NULL COMMENT '上传时间',
`storage` varchar(100) NOT NULL DEFAULT 'local' COMMENT '存储位置',
- `sha1` varchar(40) NOT NULL DEFAULT '' COMMENT '文件 sha1编码',
+ `sha1` varchar(40) DEFAULT '' COMMENT '文件 sha1编码',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT='附件表';
@@ -113,11 +113,11 @@ DROP TABLE IF EXISTS `fa_auth_group`;
CREATE TABLE `fa_auth_group` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`pid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '父组别',
- `name` varchar(100) NOT NULL DEFAULT '' COMMENT '组名',
+ `name` varchar(100) DEFAULT '' COMMENT '组名',
`rules` text NOT NULL COMMENT '规则ID',
`createtime` int(10) DEFAULT NULL COMMENT '创建时间',
`updatetime` int(10) DEFAULT NULL COMMENT '更新时间',
- `status` varchar(30) NOT NULL DEFAULT '' COMMENT '状态',
+ `status` varchar(30) DEFAULT '' COMMENT '状态',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT='分组表';
@@ -159,16 +159,16 @@ CREATE TABLE `fa_auth_rule` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`type` enum('menu','file') NOT NULL DEFAULT 'file' COMMENT 'menu为菜单,file为权限节点',
`pid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '父ID',
- `name` varchar(100) NOT NULL DEFAULT '' COMMENT '规则名称',
- `title` varchar(50) NOT NULL DEFAULT '' COMMENT '规则名称',
- `icon` varchar(50) NOT NULL DEFAULT '' COMMENT '图标',
- `condition` varchar(255) NOT NULL DEFAULT '' COMMENT '条件',
- `remark` varchar(255) NOT NULL DEFAULT '' COMMENT '备注',
+ `name` varchar(100) DEFAULT '' COMMENT '规则名称',
+ `title` varchar(50) DEFAULT '' COMMENT '规则名称',
+ `icon` varchar(50) DEFAULT '' COMMENT '图标',
+ `condition` varchar(255) DEFAULT '' COMMENT '条件',
+ `remark` varchar(255) DEFAULT '' COMMENT '备注',
`ismenu` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '是否为菜单',
`createtime` int(10) DEFAULT NULL COMMENT '创建时间',
`updatetime` int(10) DEFAULT NULL COMMENT '更新时间',
`weigh` int(10) NOT NULL DEFAULT '0' COMMENT '权重',
- `status` varchar(30) NOT NULL DEFAULT '' COMMENT '状态',
+ `status` varchar(30) DEFAULT '' COMMENT '状态',
PRIMARY KEY (`id`),
UNIQUE KEY `name` (`name`) USING BTREE,
KEY `pid` (`pid`),
@@ -270,18 +270,18 @@ DROP TABLE IF EXISTS `fa_category`;
CREATE TABLE `fa_category` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`pid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '父ID',
- `type` varchar(30) NOT NULL DEFAULT '' COMMENT '栏目类型',
- `name` varchar(30) NOT NULL DEFAULT '',
- `nickname` varchar(50) NOT NULL DEFAULT '',
- `flag` set('hot','index','recommend') NOT NULL DEFAULT '',
- `image` varchar(100) NOT NULL DEFAULT '' COMMENT '图片',
- `keywords` varchar(255) NOT NULL DEFAULT '' COMMENT '关键字',
- `description` varchar(255) NOT NULL DEFAULT '' COMMENT '描述',
- `diyname` varchar(30) NOT NULL DEFAULT '' COMMENT '自定义名称',
+ `type` varchar(30) DEFAULT '' COMMENT '栏目类型',
+ `name` varchar(30) DEFAULT '',
+ `nickname` varchar(50) DEFAULT '',
+ `flag` set('hot','index','recommend') DEFAULT '',
+ `image` varchar(100) DEFAULT '' COMMENT '图片',
+ `keywords` varchar(255) DEFAULT '' COMMENT '关键字',
+ `description` varchar(255) DEFAULT '' COMMENT '描述',
+ `diyname` varchar(30) DEFAULT '' COMMENT '自定义名称',
`createtime` int(10) DEFAULT NULL COMMENT '创建时间',
`updatetime` int(10) DEFAULT NULL COMMENT '更新时间',
`weigh` int(10) NOT NULL DEFAULT '0' COMMENT '权重',
- `status` varchar(30) NOT NULL DEFAULT '' COMMENT '状态',
+ `status` varchar(30) DEFAULT '' COMMENT '状态',
PRIMARY KEY (`id`),
KEY `weigh` (`weigh`,`id`),
KEY `pid` (`pid`)
@@ -312,15 +312,16 @@ COMMIT;
DROP TABLE IF EXISTS `fa_config`;
CREATE TABLE `fa_config` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
- `name` varchar(30) NOT NULL DEFAULT '' COMMENT '变量名',
- `group` varchar(30) NOT NULL DEFAULT '' COMMENT '分组',
- `title` varchar(100) NOT NULL DEFAULT '' COMMENT '变量标题',
- `tip` varchar(100) NOT NULL DEFAULT '' COMMENT '变量描述',
- `type` varchar(30) NOT NULL DEFAULT '' COMMENT '类型:string,text,int,bool,array,datetime,date,file',
- `value` text NOT NULL COMMENT '变量值',
- `content` text NOT NULL COMMENT '变量字典数据',
- `rule` varchar(100) NOT NULL DEFAULT '' COMMENT '验证规则',
- `extend` varchar(255) NOT NULL DEFAULT '' COMMENT '扩展属性',
+ `name` varchar(30) DEFAULT '' COMMENT '变量名',
+ `group` varchar(30) DEFAULT '' COMMENT '分组',
+ `title` varchar(100) DEFAULT '' COMMENT '变量标题',
+ `tip` varchar(100) DEFAULT '' COMMENT '变量描述',
+ `type` varchar(30) DEFAULT '' COMMENT '类型:string,text,int,bool,array,datetime,date,file',
+ `value` text COMMENT '变量值',
+ `content` text COMMENT '变量字典数据',
+ `rule` varchar(100) DEFAULT '' COMMENT '验证规则',
+ `extend` varchar(255) DEFAULT '' COMMENT '扩展属性',
+ `setting` varchar(255) DEFAULT '' COMMENT '配置',
PRIMARY KEY (`id`),
UNIQUE KEY `name` (`name`)
) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT='系统配置';
@@ -329,23 +330,23 @@ CREATE TABLE `fa_config` (
-- Records of fa_config
-- ----------------------------
BEGIN;
-INSERT INTO `fa_config` VALUES (1, 'name', 'basic', 'Site name', '请填写站点名称', 'string', '我的网站', '', 'required', '');
-INSERT INTO `fa_config` VALUES (2, 'beian', 'basic', 'Beian', '粤ICP备15000000号-1', 'string', '', '', '', '');
-INSERT INTO `fa_config` VALUES (3, 'cdnurl', 'basic', 'Cdn url', '如果静态资源使用第三方云储存请配置该值', 'string', '', '', '', '');
-INSERT INTO `fa_config` VALUES (4, 'version', 'basic', 'Version', '如果静态资源有变动请重新配置该值', 'string', '1.0.1', '', 'required', '');
-INSERT INTO `fa_config` VALUES (5, 'timezone', 'basic', 'Timezone', '', 'string', 'Asia/Shanghai', '', 'required', '');
-INSERT INTO `fa_config` VALUES (6, 'forbiddenip', 'basic', 'Forbidden ip', '一行一条记录', 'text', '', '', '', '');
-INSERT INTO `fa_config` VALUES (7, 'languages', 'basic', 'Languages', '', 'array', '{\"backend\":\"zh-cn\",\"frontend\":\"zh-cn\"}', '', 'required', '');
-INSERT INTO `fa_config` VALUES (8, 'fixedpage', 'basic', 'Fixed page', '请尽量输入左侧菜单栏存在的链接', 'string', 'dashboard', '', 'required', '');
-INSERT INTO `fa_config` VALUES (9, 'categorytype', 'dictionary', 'Category type', '', 'array', '{\"default\":\"Default\",\"page\":\"Page\",\"article\":\"Article\",\"test\":\"Test\"}', '', '', '');
-INSERT INTO `fa_config` VALUES (10, 'configgroup', 'dictionary', 'Config group', '', 'array', '{\"basic\":\"Basic\",\"email\":\"Email\",\"dictionary\":\"Dictionary\",\"user\":\"User\",\"example\":\"Example\"}', '', '', '');
-INSERT INTO `fa_config` VALUES (11, 'mail_type', 'email', 'Mail type', '选择邮件发送方式', 'select', '1', '[\"Please select\",\"SMTP\",\"Mail\"]', '', '');
-INSERT INTO `fa_config` VALUES (12, 'mail_smtp_host', 'email', 'Mail smtp host', '错误的配置发送邮件会导致服务器超时', 'string', 'smtp.qq.com', '', '', '');
-INSERT INTO `fa_config` VALUES (13, 'mail_smtp_port', 'email', 'Mail smtp port', '(不加密默认25,SSL默认465,TLS默认587)', 'string', '465', '', '', '');
-INSERT INTO `fa_config` VALUES (14, 'mail_smtp_user', 'email', 'Mail smtp user', '(填写完整用户名)', 'string', '10000', '', '', '');
-INSERT INTO `fa_config` VALUES (15, 'mail_smtp_pass', 'email', 'Mail smtp password', '(填写您的密码)', 'string', 'password', '', '', '');
-INSERT INTO `fa_config` VALUES (16, 'mail_verify_type', 'email', 'Mail vertify type', '(SMTP验证方式[推荐SSL])', 'select', '2', '[\"None\",\"TLS\",\"SSL\"]', '', '');
-INSERT INTO `fa_config` VALUES (17, 'mail_from', 'email', 'Mail from', '', 'string', '10000@qq.com', '', '', '');
+INSERT INTO `fa_config` VALUES (1, 'name', 'basic', 'Site name', '请填写站点名称', 'string', '我的网站', '', 'required', '', '');
+INSERT INTO `fa_config` VALUES (2, 'beian', 'basic', 'Beian', '粤ICP备15000000号-1', 'string', '', '', '', '', '');
+INSERT INTO `fa_config` VALUES (3, 'cdnurl', 'basic', 'Cdn url', '如果全站静态资源使用第三方云储存请配置该值', 'string', '', '', '', '', '');
+INSERT INTO `fa_config` VALUES (4, 'version', 'basic', 'Version', '如果静态资源有变动请重新配置该值', 'string', '1.0.1', '', 'required', '', '');
+INSERT INTO `fa_config` VALUES (5, 'timezone', 'basic', 'Timezone', '', 'string', 'Asia/Shanghai', '', 'required', '', '');
+INSERT INTO `fa_config` VALUES (6, 'forbiddenip', 'basic', 'Forbidden ip', '一行一条记录', 'text', '', '', '', '', '');
+INSERT INTO `fa_config` VALUES (7, 'languages', 'basic', 'Languages', '', 'array', '{\"backend\":\"zh-cn\",\"frontend\":\"zh-cn\"}', '', 'required', '', '');
+INSERT INTO `fa_config` VALUES (8, 'fixedpage', 'basic', 'Fixed page', '请尽量输入左侧菜单栏存在的链接', 'string', 'dashboard', '', 'required', '', '');
+INSERT INTO `fa_config` VALUES (9, 'categorytype', 'dictionary', 'Category type', '', 'array', '{\"default\":\"Default\",\"page\":\"Page\",\"article\":\"Article\",\"test\":\"Test\"}', '', '', '', '');
+INSERT INTO `fa_config` VALUES (10, 'configgroup', 'dictionary', 'Config group', '', 'array', '{\"basic\":\"Basic\",\"email\":\"Email\",\"dictionary\":\"Dictionary\",\"user\":\"User\",\"example\":\"Example\"}', '', '', '', '');
+INSERT INTO `fa_config` VALUES (11, 'mail_type', 'email', 'Mail type', '选择邮件发送方式', 'select', '1', '[\"请选择\",\"SMTP\",\"Mail\"]', '', '', '');
+INSERT INTO `fa_config` VALUES (12, 'mail_smtp_host', 'email', 'Mail smtp host', '错误的配置发送邮件会导致服务器超时', 'string', 'smtp.qq.com', '', '', '', '');
+INSERT INTO `fa_config` VALUES (13, 'mail_smtp_port', 'email', 'Mail smtp port', '(不加密默认25,SSL默认465,TLS默认587)', 'string', '465', '', '', '', '');
+INSERT INTO `fa_config` VALUES (14, 'mail_smtp_user', 'email', 'Mail smtp user', '(填写完整用户名)', 'string', '10000', '', '', '', '');
+INSERT INTO `fa_config` VALUES (15, 'mail_smtp_pass', 'email', 'Mail smtp password', '(填写您的密码)', 'string', 'password', '', '', '', '');
+INSERT INTO `fa_config` VALUES (16, 'mail_verify_type', 'email', 'Mail vertify type', '(SMTP验证方式[推荐SSL])', 'select', '2', '[\"无\",\"TLS\",\"SSL\"]', '', '', '');
+INSERT INTO `fa_config` VALUES (17, 'mail_from', 'email', 'Mail from', '', 'string', '10000@qq.com', '', '', '', '');
COMMIT;
-- ----------------------------
@@ -354,11 +355,11 @@ COMMIT;
DROP TABLE IF EXISTS `fa_ems`;
CREATE TABLE `fa_ems` (
`id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'ID',
- `event` varchar(30) NOT NULL DEFAULT '' COMMENT '事件',
- `email` varchar(100) NOT NULL DEFAULT '' COMMENT '邮箱',
- `code` varchar(10) NOT NULL DEFAULT '' COMMENT '验证码',
+ `event` varchar(30) DEFAULT '' COMMENT '事件',
+ `email` varchar(100) DEFAULT '' COMMENT '邮箱',
+ `code` varchar(10) DEFAULT '' COMMENT '验证码',
`times` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '验证次数',
- `ip` varchar(30) NOT NULL DEFAULT '' COMMENT 'IP',
+ `ip` varchar(30) DEFAULT '' COMMENT 'IP',
`createtime` int(10) DEFAULT NULL COMMENT '创建时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT='邮箱验证码表';
@@ -369,11 +370,11 @@ CREATE TABLE `fa_ems` (
DROP TABLE IF EXISTS `fa_sms`;
CREATE TABLE `fa_sms` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID',
- `event` varchar(30) NOT NULL DEFAULT '' COMMENT '事件',
- `mobile` varchar(20) NOT NULL DEFAULT '' COMMENT '手机号',
- `code` varchar(10) NOT NULL DEFAULT '' COMMENT '验证码',
+ `event` varchar(30) DEFAULT '' COMMENT '事件',
+ `mobile` varchar(20) DEFAULT '' COMMENT '手机号',
+ `code` varchar(10) DEFAULT '' COMMENT '验证码',
`times` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '验证次数',
- `ip` varchar(30) NOT NULL DEFAULT '' COMMENT 'IP',
+ `ip` varchar(30) DEFAULT '' COMMENT 'IP',
`createtime` int(10) unsigned DEFAULT '0' COMMENT '创建时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT='短信验证码表';
@@ -388,17 +389,17 @@ CREATE TABLE `fa_test` (
`category_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '分类ID(单选)',
`category_ids` varchar(100) NOT NULL COMMENT '分类ID(多选)',
`week` enum('monday','tuesday','wednesday') NOT NULL COMMENT '星期(单选):monday=星期一,tuesday=星期二,wednesday=星期三',
- `flag` set('hot','index','recommend') NOT NULL DEFAULT '' COMMENT '标志(多选):hot=热门,index=首页,recommend=推荐',
+ `flag` set('hot','index','recommend') DEFAULT '' COMMENT '标志(多选):hot=热门,index=首页,recommend=推荐',
`genderdata` enum('male','female') NOT NULL DEFAULT 'male' COMMENT '性别(单选):male=男,female=女',
`hobbydata` set('music','reading','swimming') NOT NULL COMMENT '爱好(多选):music=音乐,reading=读书,swimming=游泳',
- `title` varchar(50) NOT NULL DEFAULT '' COMMENT '标题',
+ `title` varchar(50) DEFAULT '' COMMENT '标题',
`content` text NOT NULL COMMENT '内容',
- `image` varchar(100) NOT NULL DEFAULT '' COMMENT '图片',
- `images` varchar(1500) NOT NULL DEFAULT '' COMMENT '图片组',
- `attachfile` varchar(100) NOT NULL DEFAULT '' COMMENT '附件',
- `keywords` varchar(100) NOT NULL DEFAULT '' COMMENT '关键字',
- `description` varchar(255) NOT NULL DEFAULT '' COMMENT '描述',
- `city` varchar(100) NOT NULL DEFAULT '' COMMENT '省市',
+ `image` varchar(100) DEFAULT '' COMMENT '图片',
+ `images` varchar(1500) DEFAULT '' COMMENT '图片组',
+ `attachfile` varchar(100) DEFAULT '' COMMENT '附件',
+ `keywords` varchar(100) DEFAULT '' COMMENT '关键字',
+ `description` varchar(255) DEFAULT '' COMMENT '描述',
+ `city` varchar(100) DEFAULT '' COMMENT '省市',
`json` varchar(255) DEFAULT NULL COMMENT '配置:key=名称,value=值',
`price` float(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '价格',
`views` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '点击',
@@ -431,32 +432,32 @@ DROP TABLE IF EXISTS `fa_user`;
CREATE TABLE `fa_user` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID',
`group_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '组别ID',
- `username` varchar(32) NOT NULL DEFAULT '' COMMENT '用户名',
- `nickname` varchar(50) NOT NULL DEFAULT '' COMMENT '昵称',
- `password` varchar(32) NOT NULL DEFAULT '' COMMENT '密码',
- `salt` varchar(30) NOT NULL DEFAULT '' COMMENT '密码盐',
- `email` varchar(100) NOT NULL DEFAULT '' COMMENT '电子邮箱',
- `mobile` varchar(11) NOT NULL DEFAULT '' COMMENT '手机号',
- `avatar` varchar(255) NOT NULL DEFAULT '' COMMENT '头像',
+ `username` varchar(32) DEFAULT '' COMMENT '用户名',
+ `nickname` varchar(50) DEFAULT '' COMMENT '昵称',
+ `password` varchar(32) DEFAULT '' COMMENT '密码',
+ `salt` varchar(30) DEFAULT '' COMMENT '密码盐',
+ `email` varchar(100) DEFAULT '' COMMENT '电子邮箱',
+ `mobile` varchar(11) DEFAULT '' COMMENT '手机号',
+ `avatar` varchar(255) DEFAULT '' COMMENT '头像',
`level` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '等级',
`gender` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '性别',
`birthday` date DEFAULT NULL COMMENT '生日',
- `bio` varchar(100) NOT NULL DEFAULT '' COMMENT '格言',
+ `bio` varchar(100) DEFAULT '' COMMENT '格言',
`money` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '余额',
`score` int(10) NOT NULL DEFAULT '0' COMMENT '积分',
`successions` int(10) unsigned NOT NULL DEFAULT '1' COMMENT '连续登录天数',
`maxsuccessions` int(10) unsigned NOT NULL DEFAULT '1' COMMENT '最大连续登录天数',
`prevtime` int(10) DEFAULT NULL COMMENT '上次登录时间',
`logintime` int(10) DEFAULT NULL COMMENT '登录时间',
- `loginip` varchar(50) NOT NULL DEFAULT '' COMMENT '登录IP',
+ `loginip` varchar(50) DEFAULT '' COMMENT '登录IP',
`loginfailure` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '失败次数',
- `joinip` varchar(50) NOT NULL DEFAULT '' COMMENT '加入IP',
+ `joinip` varchar(50) DEFAULT '' COMMENT '加入IP',
`jointime` int(10) DEFAULT NULL COMMENT '加入时间',
`createtime` int(10) DEFAULT NULL COMMENT '创建时间',
`updatetime` int(10) DEFAULT NULL COMMENT '更新时间',
- `token` varchar(50) NOT NULL DEFAULT '' COMMENT 'Token',
- `status` varchar(30) NOT NULL DEFAULT '' COMMENT '状态',
- `verification` varchar(255) NOT NULL DEFAULT '' COMMENT '验证',
+ `token` varchar(50) DEFAULT '' COMMENT 'Token',
+ `status` varchar(30) DEFAULT '' COMMENT '状态',
+ `verification` varchar(255) DEFAULT '' COMMENT '验证',
PRIMARY KEY (`id`),
KEY `username` (`username`),
KEY `email` (`email`),
@@ -501,7 +502,7 @@ CREATE TABLE `fa_user_money_log` (
`money` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '变更余额',
`before` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '变更前余额',
`after` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '变更后余额',
- `memo` varchar(255) NOT NULL DEFAULT '' COMMENT '备注',
+ `memo` varchar(255) DEFAULT '' COMMENT '备注',
`createtime` int(10) DEFAULT NULL COMMENT '创建时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT='会员余额变动表';
@@ -552,7 +553,7 @@ CREATE TABLE `fa_user_score_log` (
`score` int(10) NOT NULL DEFAULT '0' COMMENT '变更积分',
`before` int(10) NOT NULL DEFAULT '0' COMMENT '变更前积分',
`after` int(10) NOT NULL DEFAULT '0' COMMENT '变更后积分',
- `memo` varchar(255) NOT NULL DEFAULT '' COMMENT '备注',
+ `memo` varchar(255) DEFAULT '' COMMENT '备注',
`createtime` int(10) DEFAULT NULL COMMENT '创建时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT='会员积分变动表';
@@ -575,16 +576,16 @@ CREATE TABLE `fa_user_token` (
DROP TABLE IF EXISTS `fa_version`;
CREATE TABLE `fa_version` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'ID',
- `oldversion` varchar(30) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '旧版本号',
- `newversion` varchar(30) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '新版本号',
- `packagesize` varchar(30) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '包大小',
- `content` varchar(500) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '升级内容',
- `downloadurl` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '下载地址',
+ `oldversion` varchar(30) DEFAULT '' COMMENT '旧版本号',
+ `newversion` varchar(30) DEFAULT '' COMMENT '新版本号',
+ `packagesize` varchar(30) DEFAULT '' COMMENT '包大小',
+ `content` varchar(500) DEFAULT '' COMMENT '升级内容',
+ `downloadurl` varchar(255) DEFAULT '' COMMENT '下载地址',
`enforce` tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '强制更新',
`createtime` int(10) DEFAULT NULL COMMENT '创建时间',
`updatetime` int(10) DEFAULT NULL COMMENT '更新时间',
`weigh` int(10) NOT NULL DEFAULT 0 COMMENT '权重',
- `status` varchar(30) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '状态',
+ `status` varchar(30) DEFAULT '' COMMENT '状态',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT='版本表';
diff --git a/application/admin/controller/Addon.php b/application/admin/controller/Addon.php
index 5e1caca1..b27f9149 100644
--- a/application/admin/controller/Addon.php
+++ b/application/admin/controller/Addon.php
@@ -8,6 +8,7 @@ use think\addons\AddonException;
use think\addons\Service;
use think\Cache;
use think\Config;
+use think\Db;
use think\Exception;
/**
@@ -19,6 +20,7 @@ use think\Exception;
class Addon extends Backend
{
protected $model = null;
+ protected $noNeedRight = ['get_table_list'];
public function _initialize()
{
@@ -144,14 +146,31 @@ class Addon extends Backend
{
$name = $this->request->post("name");
$force = (int)$this->request->post("force");
+ $droptables = (int)$this->request->post("droptables");
if (!$name) {
$this->error(__('Parameter %s can not be empty', 'name'));
}
if (!preg_match("/^[a-zA-Z0-9]+$/", $name)) {
$this->error(__('Addon name incorrect'));
}
+ //只有开启调试且为超级管理员才允许删除相关数据库
+ $tables = [];
+ if ($droptables && Config::get("app_debug") && $this->auth->isSuperAdmin()) {
+ $tables = get_addon_tables($name);
+ }
try {
Service::uninstall($name, $force);
+ if ($tables) {
+ $prefix = Config::get('database.prefix');
+ //删除插件关联表
+ foreach ($tables as $index => $table) {
+ //忽略非插件标识的表名
+ if (!preg_match("/^{$prefix}{$name}/", $table)) {
+ continue;
+ }
+ Db::execute("DROP TABLE IF EXISTS `{$table}`");
+ }
+ }
$this->success(__('Uninstall successful'));
} catch (AddonException $e) {
$this->result($e->getData(), $e->getCode(), __($e->getMessage()));
@@ -314,7 +333,7 @@ class Addon extends Backend
$search = $this->request->get("search");
$search = htmlspecialchars(strip_tags($search));
$onlineaddons = Cache::get("onlineaddons");
- if (!is_array($onlineaddons)) {
+ if (!is_array($onlineaddons) && config('fastadmin.api_url')) {
$onlineaddons = [];
$result = Http::sendRequest(config('fastadmin.api_url') . '/addon/index', [], 'GET', [
CURLOPT_HTTPHEADER => ['Accept-Encoding:gzip'],
@@ -367,4 +386,22 @@ class Addon extends Backend
$callback = $this->request->get('callback') ? "jsonp" : "json";
return $callback($result);
}
+
+ /**
+ * 获取插件相关表
+ */
+ public function get_table_list()
+ {
+ $name = $this->request->post("name");
+ $tables = get_addon_tables($name);
+ $prefix = Config::get('database.prefix');
+ foreach ($tables as $index => $table) {
+ //忽略非插件标识的表名
+ if (!preg_match("/^{$prefix}{$name}/", $table)) {
+ unset($tables[$index]);
+ }
+ }
+ $tables = array_values($tables);
+ $this->success('', null, ['tables' => $tables]);
+ }
}
diff --git a/application/admin/controller/Ajax.php b/application/admin/controller/Ajax.php
index 816c2e83..8ea11e04 100644
--- a/application/admin/controller/Ajax.php
+++ b/application/admin/controller/Ajax.php
@@ -56,6 +56,8 @@ class Ajax extends Backend
public function upload()
{
Config::set('default_return_type', 'json');
+ //必须设定cdnurl为空,否则cdnurl函数计算错误
+ Config::set('upload.cdnurl', '');
$chunkid = $this->request->post("chunkid");
if ($chunkid) {
if (!Config::get('upload.chunking')) {
@@ -75,7 +77,7 @@ class Ajax extends Backend
} catch (UploadException $e) {
$this->error($e->getMessage());
}
- $this->success(__('Uploaded successful'), '', ['url' => $attachment->url]);
+ $this->success(__('Uploaded successful'), '', ['url' => $attachment->url, 'fullurl' => cdnurl($attachment->url, true)]);
} elseif ($method == 'clean') {
//删除冗余的分片文件
try {
@@ -108,7 +110,7 @@ class Ajax extends Backend
$this->error($e->getMessage());
}
- $this->success(__('Uploaded successful'), '', ['url' => $attachment->url]);
+ $this->success(__('Uploaded successful'), '', ['url' => $attachment->url, 'fullurl' => cdnurl($attachment->url, true)]);
}
}
@@ -171,6 +173,9 @@ class Ajax extends Backend
$offset = isset($temp[$m - 1]) ? $temp[$m - 1] : $sour_id;
}
}
+ if (!isset($weighdata[$offset])) {
+ continue;
+ }
$weighids[$n] = $weighdata[$offset];
Db::name($table)->where($prikey, $n)->update([$field => $weighdata[$offset]]);
}
diff --git a/application/admin/controller/auth/Admin.php b/application/admin/controller/auth/Admin.php
index a8d23606..0d0eb6e4 100644
--- a/application/admin/controller/auth/Admin.php
+++ b/application/admin/controller/auth/Admin.php
@@ -22,6 +22,8 @@ class Admin extends Backend
* @var \app\admin\model\Admin
*/
protected $model = null;
+ protected $selectpageFields = 'id,username,nickname,avatar';
+ protected $searchFields = 'id,username,nickname';
protected $childrenGroupIds = [];
protected $childrenAdminIds = [];
@@ -218,6 +220,10 @@ class Admin extends Backend
*/
public function del($ids = "")
{
+ if (!$this->request->isPost()) {
+ $this->error(__("Invalid parameters"));
+ }
+ $ids = $ids ? $ids : $this->request->post("ids");
if ($ids) {
$ids = array_intersect($this->childrenAdminIds, array_filter(explode(',', $ids)));
// 避免越权删除管理员
diff --git a/application/admin/controller/auth/Adminlog.php b/application/admin/controller/auth/Adminlog.php
index 1652ed0a..1db61a25 100644
--- a/application/admin/controller/auth/Adminlog.php
+++ b/application/admin/controller/auth/Adminlog.php
@@ -8,7 +8,7 @@ use app\common\controller\Backend;
/**
* 管理员日志
*
- * @icon fa fa-users
+ * @icon fa fa-users
* @remark 管理员可以查看自己所拥有的权限的管理员日志
*/
class Adminlog extends Backend
@@ -30,7 +30,7 @@ class Adminlog extends Backend
$this->childrenGroupIds = $this->auth->getChildrenGroupIds($this->auth->isSuperAdmin() ? true : false);
$groupName = AuthGroup::where('id', 'in', $this->childrenGroupIds)
- ->column('id,name');
+ ->column('id,name');
$this->view->assign('groupdata', $groupName);
}
@@ -40,21 +40,20 @@ class Adminlog extends Backend
*/
public function index()
{
- if ($this->request->isAjax())
- {
+ if ($this->request->isAjax()) {
list($where, $sort, $order, $offset, $limit) = $this->buildparams();
$total = $this->model
- ->where($where)
- ->where('admin_id', 'in', $this->childrenAdminIds)
- ->order($sort, $order)
- ->count();
+ ->where($where)
+ ->where('admin_id', 'in', $this->childrenAdminIds)
+ ->order($sort, $order)
+ ->count();
$list = $this->model
- ->where($where)
- ->where('admin_id', 'in', $this->childrenAdminIds)
- ->order($sort, $order)
- ->limit($offset, $limit)
- ->select();
+ ->where($where)
+ ->where('admin_id', 'in', $this->childrenAdminIds)
+ ->order($sort, $order)
+ ->limit($offset, $limit)
+ ->select();
$result = array("total" => $total, "rows" => $list);
return json($result);
@@ -68,8 +67,9 @@ class Adminlog extends Backend
public function detail($ids)
{
$row = $this->model->get(['id' => $ids]);
- if (!$row)
+ if (!$row) {
$this->error(__('No Results were found'));
+ }
$this->view->assign("row", $row->toArray());
return $this->view->fetch();
}
@@ -87,7 +87,7 @@ class Adminlog extends Backend
* 编辑
* @internal
*/
- public function edit($ids = NULL)
+ public function edit($ids = null)
{
$this->error();
}
@@ -97,21 +97,21 @@ class Adminlog extends Backend
*/
public function del($ids = "")
{
- if ($ids)
- {
+ if (!$this->request->isPost()) {
+ $this->error(__("Invalid parameters"));
+ }
+ $ids = $ids ? $ids : $this->request->post("ids");
+ if ($ids) {
$childrenGroupIds = $this->childrenGroupIds;
- $adminList = $this->model->where('id', 'in', $ids)->where('admin_id', 'in', function($query) use($childrenGroupIds) {
- $query->name('auth_group_access')->field('uid');
- })->select();
- if ($adminList)
- {
+ $adminList = $this->model->where('id', 'in', $ids)->where('admin_id', 'in', function ($query) use ($childrenGroupIds) {
+ $query->name('auth_group_access')->field('uid');
+ })->select();
+ if ($adminList) {
$deleteIds = [];
- foreach ($adminList as $k => $v)
- {
+ foreach ($adminList as $k => $v) {
$deleteIds[] = $v->id;
}
- if ($deleteIds)
- {
+ if ($deleteIds) {
$this->model->destroy($deleteIds);
$this->success();
}
@@ -129,10 +129,9 @@ class Adminlog extends Backend
// 管理员禁止批量操作
$this->error();
}
-
+
public function selectpage()
{
return parent::selectpage();
}
-
}
diff --git a/application/admin/controller/auth/Group.php b/application/admin/controller/auth/Group.php
index 0e82c8d8..218ae8dd 100644
--- a/application/admin/controller/auth/Group.php
+++ b/application/admin/controller/auth/Group.php
@@ -11,7 +11,7 @@ use think\Exception;
/**
* 角色组
*
- * @icon fa fa-group
+ * @icon fa fa-group
* @remark 角色组可以有多个,角色有上下级层级关系,如果子角色有角色组和管理员的权限则可以派生属于自己组别下级的角色组或管理员
*/
class Group extends Backend
@@ -140,7 +140,7 @@ class Group extends Backend
$this->error(__('The parent group exceeds permission limit'));
}
// 父节点不能是它自身的子节点或自己本身
- if (in_array($params['pid'], Tree::instance()->getChildrenIds($row->id,true))){
+ if (in_array($params['pid'], Tree::instance()->getChildrenIds($row->id, true))) {
$this->error(__('The parent group can not be its own child or itself'));
}
$params['rules'] = explode(',', $params['rules']);
@@ -163,16 +163,16 @@ class Group extends Backend
Db::startTrans();
try {
$row->save($params);
- $children_auth_groups = model("AuthGroup")->all(['id'=>['in',implode(',',(Tree::instance()->getChildrenIds($row->id)))]]);
+ $children_auth_groups = model("AuthGroup")->all(['id' => ['in', implode(',', (Tree::instance()->getChildrenIds($row->id)))]]);
$childparams = [];
- foreach ($children_auth_groups as $key=>$children_auth_group) {
+ foreach ($children_auth_groups as $key => $children_auth_group) {
$childparams[$key]['id'] = $children_auth_group->id;
$childparams[$key]['rules'] = implode(',', array_intersect(explode(',', $children_auth_group->rules), $rules));
}
model("AuthGroup")->saveAll($childparams);
Db::commit();
$this->success();
- }catch (Exception $e){
+ } catch (Exception $e) {
Db::rollback();
$this->error($e->getMessage());
}
@@ -189,6 +189,10 @@ class Group extends Backend
*/
public function del($ids = "")
{
+ if (!$this->request->isPost()) {
+ $this->error(__("Invalid parameters"));
+ }
+ $ids = $ids ? $ids : $this->request->post("ids");
if ($ids) {
$ids = explode(',', $ids);
$grouplist = $this->auth->getGroups();
diff --git a/application/admin/controller/auth/Rule.php b/application/admin/controller/auth/Rule.php
index 764e628b..310d3830 100644
--- a/application/admin/controller/auth/Rule.php
+++ b/application/admin/controller/auth/Rule.php
@@ -134,6 +134,10 @@ class Rule extends Backend
*/
public function del($ids = "")
{
+ if (!$this->request->isPost()) {
+ $this->error(__("Invalid parameters"));
+ }
+ $ids = $ids ? $ids : $this->request->post("ids");
if ($ids) {
$delIds = [];
foreach (explode(',', $ids) as $k => $v) {
diff --git a/application/admin/controller/general/Attachment.php b/application/admin/controller/general/Attachment.php
index ba8cbb1c..352f489e 100644
--- a/application/admin/controller/general/Attachment.php
+++ b/application/admin/controller/general/Attachment.php
@@ -103,6 +103,10 @@ class Attachment extends Backend
*/
public function del($ids = "")
{
+ if (!$this->request->isPost()) {
+ $this->error(__("Invalid parameters"));
+ }
+ $ids = $ids ? $ids : $this->request->post("ids");
if ($ids) {
\think\Hook::add('upload_delete', function ($params) {
if ($params['storage'] == 'local') {
diff --git a/application/admin/controller/general/Config.php b/application/admin/controller/general/Config.php
index 24b405a4..eb1739d8 100644
--- a/application/admin/controller/general/Config.php
+++ b/application/admin/controller/general/Config.php
@@ -5,6 +5,8 @@ namespace app\admin\controller\general;
use app\common\controller\Backend;
use app\common\library\Email;
use app\common\model\Config as ConfigModel;
+use think\Cache;
+use think\Db;
use think\Exception;
use think\Validate;
@@ -21,7 +23,7 @@ class Config extends Backend
* @var \app\common\model\Config
*/
protected $model = null;
- protected $noNeedRight = ['check', 'rulelist'];
+ protected $noNeedRight = ['check', 'rulelist', 'selectpage', 'get_fields_list'];
public function _initialize()
{
@@ -82,7 +84,7 @@ class Config extends Backend
$params = $this->request->post("row/a", [], 'trim');
if ($params) {
foreach ($params as $k => &$v) {
- $v = is_array($v) ? implode(',', $v) : $v;
+ $v = is_array($v) && $k !== 'setting' ? implode(',', $v) : $v;
}
if (in_array($params['type'], ['select', 'selects', 'checkbox', 'radio', 'array'])) {
$params['content'] = json_encode(ConfigModel::decode($params['content']), JSON_UNESCAPED_UNICODE);
@@ -202,12 +204,12 @@ class Config extends Backend
if ($params) {
$config = $this->model->get($params);
if (!$config) {
- return $this->success();
+ $this->success();
} else {
- return $this->error(__('Name already exist'));
+ $this->error(__('Name already exist'));
}
} else {
- return $this->error(__('Invalid parameters'));
+ $this->error(__('Invalid parameters'));
}
}
@@ -262,7 +264,51 @@ class Config extends Backend
$this->error($email->getError());
}
} else {
- return $this->error(__('Invalid parameters'));
+ $this->error(__('Invalid parameters'));
}
}
+
+ public function selectpage()
+ {
+ $id = $this->request->get("id/d");
+ $config = \app\common\model\Config::get($id);
+ if (!$config) {
+ $this->error(__('Invalid parameters'));
+ }
+ $setting = $config['setting'];
+ //自定义条件
+ $custom = isset($setting['conditions']) ? (array)json_decode($setting['conditions'], true) : [];
+ $custom = array_filter($custom);
+
+ $this->request->request(['showField' => $setting['field'], 'keyField' => $setting['primarykey'], 'custom' => $custom, 'searchField' => [$setting['field'], $setting['primarykey']]]);
+ $this->model = \think\Db::connect()->setTable($setting['table']);
+ return parent::selectpage();
+ }
+
+ /**
+ * 获取表列表
+ * @internal
+ */
+ public function get_table_list()
+ {
+ $tableList = [];
+ $dbname = \think\Config::get('database.database');
+ $tableList = \think\Db::query("SELECT `TABLE_NAME` AS `name`,`TABLE_COMMENT` AS `title` FROM `information_schema`.`TABLES` where `TABLE_SCHEMA` = '{$dbname}';");
+ $this->success('', null, ['tableList' => $tableList]);
+ }
+
+ /**
+ * 获取表字段列表
+ * @internal
+ */
+ public function get_fields_list()
+ {
+ $table = $this->request->request('table');
+ $dbname = \think\Config::get('database.database');
+ //从数据库中获取表字段信息
+ $sql = "SELECT `COLUMN_NAME` AS `name`,`COLUMN_COMMENT` AS `title`,`DATA_TYPE` AS `type` FROM `information_schema`.`columns` WHERE TABLE_SCHEMA = ? AND TABLE_NAME = ? ORDER BY ORDINAL_POSITION";
+ //加载主表的列
+ $fieldList = Db::query($sql, [$dbname, $table]);
+ $this->success("", null, ['fieldList' => $fieldList]);
+ }
}
diff --git a/application/admin/controller/user/Rule.php b/application/admin/controller/user/Rule.php
index 3dfa64e7..611d6871 100644
--- a/application/admin/controller/user/Rule.php
+++ b/application/admin/controller/user/Rule.php
@@ -87,6 +87,10 @@ class Rule extends Backend
*/
public function del($ids = "")
{
+ if (!$this->request->isPost()) {
+ $this->error(__("Invalid parameters"));
+ }
+ $ids = $ids ? $ids : $this->request->post("ids");
if ($ids) {
$delIds = [];
foreach (explode(',', $ids) as $k => $v) {
diff --git a/application/admin/controller/user/User.php b/application/admin/controller/user/User.php
index 9a3ee80d..47636bdf 100644
--- a/application/admin/controller/user/User.php
+++ b/application/admin/controller/user/User.php
@@ -52,6 +52,7 @@ class User extends Backend
->limit($offset, $limit)
->select();
foreach ($list as $k => $v) {
+ $v->avatar = $v->avatar ? cdnurl($v->avatar, true) : letter_avatar($v->nickname);
$v->hidden(['password', 'salt']);
}
$result = array("total" => $total, "rows" => $list);
@@ -94,6 +95,10 @@ class User extends Backend
*/
public function del($ids = "")
{
+ if (!$this->request->isPost()) {
+ $this->error(__("Invalid parameters"));
+ }
+ $ids = $ids ? $ids : $this->request->post("ids");
$row = $this->model->get($ids);
$this->modelValidate = true;
if (!$row) {
diff --git a/application/admin/lang/zh-cn.php b/application/admin/lang/zh-cn.php
index 56e3a58c..ca7802bb 100755
--- a/application/admin/lang/zh-cn.php
+++ b/application/admin/lang/zh-cn.php
@@ -96,6 +96,9 @@ return [
'End time' => '结束时间',
'Create time' => '创建时间',
'Update time' => '更新时间',
+ 'Createtime' => '创建时间',
+ 'Updatetime' => '更新时间',
+ 'Deletetime' => '删除时间',
'Flag' => '标志',
'Drag to sort' => '拖动进行排序',
'Redirect now' => '立即跳转',
@@ -164,7 +167,7 @@ return [
'An unexpected error occurred' => '发生了一个意外错误,程序猿正在紧急处理中',
'This page will be re-directed in %s seconds' => '页面将在 %s 秒后自动跳转',
'Click to uncheck all' => '点击取消全部',
- 'Multiple selection mode: %s checked' => '跨页选择模式,已选 %s 项',
+ 'Multiple selection mode: %s checked' => '跨页选择模式,已选 %s 项',
//菜单
'Dashboard' => '控制台',
'General' => '常规管理',
diff --git a/application/admin/lang/zh-cn/addon.php b/application/admin/lang/zh-cn/addon.php
index 9e40a64c..c8b7f1ad 100755
--- a/application/admin/lang/zh-cn/addon.php
+++ b/application/admin/lang/zh-cn/addon.php
@@ -1,93 +1,97 @@
'ID',
- 'Title' => '插件名称',
- 'Value' => '配置值',
- 'Array key' => '键',
- 'Array value' => '值',
- 'File' => '文件',
- 'Donate' => '打赏作者',
- 'Warmtips' => '温馨提示',
- 'Pay now' => '立即支付',
- 'Offline install' => '离线安装',
- 'Refresh addon cache' => '刷新插件缓存',
- 'Userinfo' => '会员信息',
- 'Online store' => '在线商店',
- 'Local addon' => '本地插件',
- 'Conflict tips' => '此插件中发现和现有系统中部分文件发现冲突!以下文件将会被影响,请备份好相关文件后再继续操作',
- 'Login tips' => '此处登录账号为FastAdmin官网账号 ',
- 'Logined tips' => '你好!%s 当前你已经登录,将同步保存你的购买记录',
- 'Pay tips' => '扫码支付后如果仍然无法立即下载,请不要重复支付,请稍后再重试安装!',
- 'Pay click tips' => '请点击这里在新窗口中进行支付!',
- 'Pay new window tips' => '请在新弹出的窗口中进行支付,支付完成后再重新点击安装按钮进行安装!',
- 'Uninstall tips' => '确认卸载[%s] ?卸载将会删除所有插件文件且不可找回!!! 插件如果有创建数据库表请手动删除!!!
如有重要数据请备份后再操作!',
- 'Upgrade tips' => '确认升级[%s] ?升级后可能出现部分冗余数据记录,请根据需要移除即可!!!
如有重要数据请备份后再操作!',
- 'Offline installed tips' => '插件安装成功!清除浏览器缓存和框架缓存后生效!',
- 'Online installed tips' => '插件安装成功!清除浏览器缓存和框架缓存后生效!',
- 'Not login tips' => '你当前未登录FastAdmin,登录后将同步已购买的记录,下载时无需二次付费!',
- 'Not installed tips' => '请安装后再访问插件前台页面!',
- 'Not enabled tips' => '插件已经禁用,请启用后再访问插件前台页面!',
- 'New version tips' => '发现新版本:%s 点击查看更新日志',
- 'Store now available tips' => '插件市场暂不可用,是否切换到本地插件?',
- 'Switch to the local' => '切换到本地插件',
- 'try to reload' => '重新尝试加载',
- 'Please disable addon first' => '请先禁用插件再进行升级',
- 'Login now' => '立即登录',
- 'Continue install' => '不登录,继续安装',
- 'View addon home page' => '查看插件介绍和帮助',
- 'View addon index page' => '查看插件前台首页',
- 'View addon screenshots' => '点击查看插件截图',
- 'Click to toggle status' => '点击切换插件状态',
- 'Click to contact developer' => '点击与插件开发者取得联系',
- 'My addons' => '我购买的插件',
- 'My posts' => '我发布的插件',
- 'Index' => '前台',
- 'All' => '全部',
- 'Uncategoried' => '未归类',
- 'Recommend' => '推荐',
- 'Hot' => '热门',
- 'New' => '新',
- 'Paying' => '付费',
- 'Free' => '免费',
- 'Sale' => '折扣',
- 'No image' => '暂无缩略图',
- 'Price' => '价格',
- 'Downloads' => '下载',
- 'Author' => '作者',
- 'Identify' => '标识',
- 'Homepage' => '主页',
- 'Intro' => '介绍',
- 'Version' => '版本',
- 'New version' => '新版本',
- 'Createtime' => '添加时间',
- 'Releasetime' => '更新时间',
- 'Detail' => '插件详情',
- 'Document' => '文档',
- 'Demo' => '演示',
- 'Feedback' => '反馈BUG',
- 'Install' => '安装',
- 'Uninstall' => '卸载',
- 'Upgrade' => '升级',
- 'Setting' => '配置',
- 'Disable' => '禁用',
- 'Enable' => '启用',
- 'Your username or email' => '你的手机号、用户名或邮箱',
- 'Your password' => '你的密码',
- 'Login FastAdmin' => '登录',
- 'Login' => '登录',
- 'Logout' => '退出登录',
- 'Register' => '注册账号',
- 'You\'re not login' => '当前未登录',
- 'Continue uninstall' => '继续卸载',
- 'Continue operate' => '继续操作',
- 'Install successful' => '安装成功',
- 'Uninstall successful' => '卸载成功',
- 'Operate successful' => '操作成功',
- 'Addon name incorrect' => '插件名称不正确',
- 'Addon info file was not found' => '插件配置文件未找到',
- 'Addon info file data incorrect' => '插件配置信息不正确',
- 'Addon already exists' => '上传的插件已经存在',
- 'Unable to open the zip file' => '无法打开ZIP文件',
- 'Unable to extract the file' => '无法解压ZIP文件',
+ 'Id' => 'ID',
+ 'Title' => '名称',
+ 'Value' => '配置值',
+ 'Array key' => '键',
+ 'Array value' => '值',
+ 'File' => '文件',
+ 'Donate' => '打赏作者',
+ 'Warmtips' => '温馨提示',
+ 'Pay now' => '立即支付',
+ 'Offline install' => '离线安装',
+ 'Refresh addon cache' => '刷新插件缓存',
+ 'Userinfo' => '会员信息',
+ 'Online store' => '在线商店',
+ 'Local addon' => '本地插件',
+ 'Conflict tips' => '此插件中发现和现有系统中部分文件发现冲突!以下文件将会被影响,请备份好相关文件后再继续操作',
+ 'Login tips' => '此处登录账号为FastAdmin官网账号 ',
+ 'Logined tips' => '你好!%s 当前你已经登录,将同步保存你的购买记录',
+ 'Pay tips' => '扫码支付后如果仍然无法立即下载,请不要重复支付,请稍后再重试安装!',
+ 'Pay click tips' => '请点击这里在新窗口中进行支付!',
+ 'Pay new window tips' => '请在新弹出的窗口中进行支付,支付完成后再重新点击安装按钮进行安装!',
+ 'Upgrade tips' => '确认升级[%s] ?升级后可能出现部分冗余数据记录,请根据需要移除即可!!!
如有重要数据请备份后再操作!',
+ 'Offline installed tips' => '插件安装成功!清除浏览器缓存和框架缓存后生效!',
+ 'Online installed tips' => '插件安装成功!清除浏览器缓存和框架缓存后生效!',
+ 'Not login tips' => '你当前未登录FastAdmin,登录后将同步已购买的记录,下载时无需二次付费!',
+ 'Not installed tips' => '请安装后再访问插件前台页面!',
+ 'Not enabled tips' => '插件已经禁用,请启用后再访问插件前台页面!',
+ 'New version tips' => '发现新版本:%s 点击查看更新日志',
+ 'Store now available tips' => '插件市场暂不可用,是否切换到本地插件?',
+ 'Switch to the local' => '切换到本地插件',
+ 'try to reload' => '重新尝试加载',
+ 'Please disable addon first' => '请先禁用插件再进行升级',
+ 'Login now' => '立即登录',
+ 'Continue install' => '不登录,继续安装',
+ 'View addon home page' => '查看插件介绍和帮助',
+ 'View addon index page' => '查看插件前台首页',
+ 'View addon screenshots' => '点击查看插件截图',
+ 'Click to toggle status' => '点击切换插件状态',
+ 'Click to contact developer' => '点击与插件开发者取得联系',
+ 'My addons' => '我购买的插件',
+ 'Index' => '前台',
+ 'All' => '全部',
+ 'Uncategoried' => '未归类',
+ 'Recommend' => '推荐',
+ 'Hot' => '热门',
+ 'New' => '新',
+ 'Paying' => '付费',
+ 'Free' => '免费',
+ 'Sale' => '折扣',
+ 'No image' => '暂无缩略图',
+ 'Price' => '价格',
+ 'Downloads' => '下载',
+ 'Author' => '作者',
+ 'Identify' => '标识',
+ 'Homepage' => '主页',
+ 'Intro' => '介绍',
+ 'Version' => '版本',
+ 'New version' => '新版本',
+ 'Createtime' => '添加时间',
+ 'Releasetime' => '更新时间',
+ 'Detail' => '插件详情',
+ 'Document' => '文档',
+ 'Demo' => '演示',
+ 'Feedback' => '反馈BUG',
+ 'Install' => '安装',
+ 'Uninstall' => '卸载',
+ 'Upgrade' => '升级',
+ 'Setting' => '配置',
+ 'Disable' => '禁用',
+ 'Enable' => '启用',
+ 'Your username or email' => '你的手机号、用户名或邮箱',
+ 'Your password' => '你的密码',
+ 'Login FastAdmin' => '登录',
+ 'Login' => '登录',
+ 'Logout' => '退出登录',
+ 'Register' => '注册账号',
+ 'You\'re not login' => '当前未登录',
+ 'Continue uninstall' => '继续卸载',
+ 'Continue operate' => '继续操作',
+ 'Install successful' => '安装成功',
+ 'Uninstall successful' => '卸载成功',
+ 'Operate successful' => '操作成功',
+ 'Addon name incorrect' => '插件名称不正确',
+ 'Addon info file was not found' => '插件配置文件未找到',
+ 'Addon info file data incorrect' => '插件配置信息不正确',
+ 'Addon already exists' => '上传的插件已经存在',
+ 'Unable to open the zip file' => '无法打开ZIP文件',
+ 'Unable to extract the file' => '无法解压ZIP文件',
+ 'Are you sure you want to unstall %s?' => '确认卸载插件《%s》?',
+ 'Delete all the addon file and cannot be recovered!' => '卸载将会删除所有插件文件且不可找回!!!',
+ 'Delete all the addon database and cannot be recovered!' => '删除所有插件相关数据表且不可找回!!!',
+ 'Please backup important data manually before uninstall!' => '如有重要数据请备份后再操作!!!',
+ 'The following data tables will be deleted' => '以下插件数据表将会被删除',
+ 'The Addon did not create a data table' => '插件未创建任何数据表',
];
diff --git a/application/admin/lang/zh-cn/general/attachment.php b/application/admin/lang/zh-cn/general/attachment.php
index c7636561..90fe66d7 100644
--- a/application/admin/lang/zh-cn/general/attachment.php
+++ b/application/admin/lang/zh-cn/general/attachment.php
@@ -13,6 +13,12 @@ return [
'Filename' => '文件名',
'Filesize' => '文件大小',
'Mimetype' => 'Mime类型',
+ 'Image' => '图片',
+ 'Audio' => '音频',
+ 'Video' => '视频',
+ 'Text' => '文档',
+ 'Application' => '应用',
+ 'Zip' => '压缩包',
'Extparam' => '透传数据',
'Createtime' => '创建日期',
'Uploadtime' => '上传时间',
diff --git a/application/admin/lang/zh-cn/general/config.php b/application/admin/lang/zh-cn/general/config.php
index 3904648e..81d79c0f 100644
--- a/application/admin/lang/zh-cn/general/config.php
+++ b/application/admin/lang/zh-cn/general/config.php
@@ -21,6 +21,7 @@ return [
'Date' => '日期',
'Time' => '时间',
'Datetime' => '日期时间',
+ 'Datetimerange' => '日期时间区间',
'Image' => '图片',
'Images' => '图片(多)',
'File' => '文件',
@@ -33,7 +34,17 @@ return [
'Array' => '数组',
'Array key' => '键名',
'Array value' => '键值',
+ 'City' => '城市地区',
+ 'Selectpage' => '关联表',
+ 'Selectpages' => '关联表(多选)',
'Custom' => '自定义',
+ 'Please select table' => '关联表',
+ 'Selectpage table' => '关联表',
+ 'Selectpage primarykey' => '存储字段',
+ 'Selectpage field' => '显示字段',
+ 'Selectpage conditions' => '筛选条件',
+ 'Field title' => '字段名',
+ 'Field value' => '字段值',
'Content' => '数据列表',
'Rule' => '校验规则',
'Site name' => '站点名称',
diff --git a/application/admin/library/traits/Backend.php b/application/admin/library/traits/Backend.php
index f3eab956..6b8450d4 100755
--- a/application/admin/library/traits/Backend.php
+++ b/application/admin/library/traits/Backend.php
@@ -200,7 +200,10 @@ trait Backend
*/
public function del($ids = "")
{
- $ids = $this->request->post("ids");
+ if (!$this->request->isPost()) {
+ $this->error(__("Invalid parameters"));
+ }
+ $ids = $ids ? $ids : $this->request->post("ids");
if ($ids) {
$pk = $this->model->getPk();
$adminIds = $this->getDataLimitAdminIds();
@@ -237,6 +240,10 @@ trait Backend
*/
public function destroy($ids = "")
{
+ if (!$this->request->isPost()) {
+ $this->error(__("Invalid parameters"));
+ }
+ $ids = $ids ? $ids : $this->request->post("ids");
$pk = $this->model->getPk();
$adminIds = $this->getDataLimitAdminIds();
if (is_array($adminIds)) {
@@ -273,6 +280,10 @@ trait Backend
*/
public function restore($ids = "")
{
+ if (!$this->request->isPost()) {
+ $this->error(__("Invalid parameters"));
+ }
+ $ids = $ids ? $ids : $this->request->post("ids");
$pk = $this->model->getPk();
$adminIds = $this->getDataLimitAdminIds();
if (is_array($adminIds)) {
@@ -307,8 +318,10 @@ trait Backend
*/
public function multi($ids = "")
{
- $ids = $ids ? $ids : $this->request->param("ids");
- $ids = $this->request->param("ids");
+ if (!$this->request->isPost()) {
+ $this->error(__("Invalid parameters"));
+ }
+ $ids = $ids ? $ids : $this->request->post("ids");
if ($ids) {
if ($this->request->has('params')) {
parse_str($this->request->post("params"), $values);
diff --git a/application/admin/view/addon/index.html b/application/admin/view/addon/index.html
index bef08766..6f0d93a1 100644
--- a/application/admin/view/addon/index.html
+++ b/application/admin/view/addon/index.html
@@ -53,11 +53,13 @@
position: absolute;
box-shadow: 0px 0px 2px #f11414;
}
+
.form-userinfo .breadcrumb {
- margin-bottom:10px;
+ margin-bottom: 10px;
}
+
.btn-toggle {
- padding:0;
+ padding: 0;
}
@@ -205,6 +206,17 @@
<%}%>
+
diff --git a/application/admin/view/dashboard/index.html b/application/admin/view/dashboard/index.html
index 061930ed..bdfa54ed 100644
--- a/application/admin/view/dashboard/index.html
+++ b/application/admin/view/dashboard/index.html
@@ -149,6 +149,16 @@
.item {
padding: 30px 0;
}
+
+
+
+ #statistics .panel {
+ min-height: 150px;
+ }
+
+ #statistics .panel h5 {
+ font-size: 13px;
+ }
-
+
-
+
- {:__('Real time')}
+ {:__('Real time')}
{:__('Category count')}
@@ -295,10 +305,10 @@
-
+
- {:__('Real time')}
+ {:__('Real time')}
{:__('Attachment count')}
@@ -311,7 +321,7 @@
-
+
{:__('Real time')}
@@ -338,7 +348,7 @@
-
+
{:__('Real time')}
@@ -376,10 +386,12 @@
+
\ No newline at end of file
+
+
diff --git a/application/admin/view/general/attachment/add.html b/application/admin/view/general/attachment/add.html
index edcdd810..d5248172 100644
--- a/application/admin/view/general/attachment/add.html
+++ b/application/admin/view/general/attachment/add.html
@@ -11,6 +11,9 @@
{:__("Upload to third")}
+ {if $config.upload.chunking}
+ {:__("Upload to third by chunk")}
+ {/if}
{/if}
@@ -26,6 +29,9 @@
{:__("Upload to local")}
+ {if $config.upload.chunking}
+ {:__("Upload to local by chunk")}
+ {/if}
diff --git a/application/admin/view/general/attachment/select.html b/application/admin/view/general/attachment/select.html
index edd30fe5..f4aaf1fc 100644
--- a/application/admin/view/general/attachment/select.html
+++ b/application/admin/view/general/attachment/select.html
@@ -11,7 +11,7 @@
{/if}
-
+
diff --git a/application/admin/view/general/config/index.html b/application/admin/view/general/config/index.html
index efa9cd66..1f7bd35c 100644
--- a/application/admin/view/general/config/index.html
+++ b/application/admin/view/general/config/index.html
@@ -59,49 +59,56 @@