diff --git a/application/admin/command/Install/fastadmin.sql b/application/admin/command/Install/fastadmin.sql index 2a5a8c9c..b8cb3d2e 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,16 +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 '扩展属性', - `setting` 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='系统配置'; @@ -355,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='邮箱验证码表'; @@ -370,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='短信验证码表'; @@ -389,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 '点击', @@ -432,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`), @@ -502,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='会员余额变动表'; @@ -553,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='会员积分变动表'; @@ -576,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/lang/zh-cn/general/config.php b/application/admin/lang/zh-cn/general/config.php index 242f77a6..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' => '文件', diff --git a/application/admin/view/general/config/index.html b/application/admin/view/general/config/index.html index 17f66276..fea64f4a 100644 --- a/application/admin/view/general/config/index.html +++ b/application/admin/view/general/config/index.html @@ -78,16 +78,19 @@ {/case} {case date} - + {/case} {case time} - + {/case} {case datetime} - + + {/case} + {case datetimerange} + {/case} {case number} - + {/case} {case checkbox} {foreach name="item.content" item="vo"} diff --git a/application/common/model/Config.php b/application/common/model/Config.php index 395b5b8b..0ed90d18 100644 --- a/application/common/model/Config.php +++ b/application/common/model/Config.php @@ -32,27 +32,28 @@ class Config extends Model public static function getTypeList() { $typeList = [ - 'string' => __('String'), - 'text' => __('Text'), - 'editor' => __('Editor'), - 'number' => __('Number'), - 'date' => __('Date'), - 'time' => __('Time'), - 'datetime' => __('Datetime'), - 'select' => __('Select'), - 'selects' => __('Selects'), - 'image' => __('Image'), - 'images' => __('Images'), - 'file' => __('File'), - 'files' => __('Files'), - 'switch' => __('Switch'), - 'checkbox' => __('Checkbox'), - 'radio' => __('Radio'), - 'city' => __('City'), - 'selectpage' => __('Selectpage'), - 'selectpages' => __('Selectpages'), - 'array' => __('Array'), - 'custom' => __('Custom'), + 'string' => __('String'), + 'text' => __('Text'), + 'editor' => __('Editor'), + 'number' => __('Number'), + 'date' => __('Date'), + 'time' => __('Time'), + 'datetime' => __('Datetime'), + 'datetimerange' => __('Datetimerange'), + 'select' => __('Select'), + 'selects' => __('Selects'), + 'image' => __('Image'), + 'images' => __('Images'), + 'file' => __('File'), + 'files' => __('Files'), + 'switch' => __('Switch'), + 'checkbox' => __('Checkbox'), + 'radio' => __('Radio'), + 'city' => __('City'), + 'selectpage' => __('Selectpage'), + 'selectpages' => __('Selectpages'), + 'array' => __('Array'), + 'custom' => __('Custom'), ]; return $typeList; } diff --git a/application/index/controller/User.php b/application/index/controller/User.php index 2f1dc836..f2e4a3f2 100644 --- a/application/index/controller/User.php +++ b/application/index/controller/User.php @@ -6,6 +6,7 @@ use addons\wechat\model\WechatCaptcha; use app\common\controller\Frontend; use app\common\library\Ems; use app\common\library\Sms; +use app\common\model\Attachment; use think\Config; use think\Cookie; use think\Hook; @@ -272,4 +273,53 @@ class User extends Frontend $this->view->assign('title', __('Change password')); return $this->view->fetch(); } + + public function attachment() + { + //设置过滤方法 + $this->request->filter(['strip_tags']); + if ($this->request->isAjax()) { + $mimetypeQuery = []; + $filter = $this->request->request('filter'); + $filterArr = (array)json_decode($filter, true); + if (isset($filterArr['mimetype']) && preg_match("/[]\,|\*]/", $filterArr['mimetype'])) { + $this->request->get(['filter' => json_encode(array_diff_key($filterArr, ['mimetype' => '']))]); + $mimetypeQuery = function ($query) use ($filterArr) { + $mimetypeArr = explode(',', $filterArr['mimetype']); + foreach ($mimetypeArr as $index => $item) { + if (stripos($item, "/*") !== false) { + $query->whereOr('mimetype', 'like', str_replace("/*", "/", $item) . '%'); + } else { + $query->whereOr('mimetype', 'like', '%' . $item . '%'); + } + } + }; + } + $model = new Attachment(); + $offset = $this->request->get("offset", 0); + $limit = $this->request->get("limit", 0); + $total = $model + ->where($mimetypeQuery) + ->where('user_id', $this->auth->id) + ->order("id", "DESC") + ->count(); + + $list = $model + ->where($mimetypeQuery) + ->where('user_id', $this->auth->id) + ->order("id", "DESC") + ->limit($offset, $limit) + ->select(); + $cdnurl = preg_replace("/\/(\w+)\.php$/i", '', $this->request->root()); + foreach ($list as $k => &$v) { + $v['fullurl'] = ($v['storage'] == 'local' ? $cdnurl : $this->view->config['upload']['cdnurl']) . $v['url']; + } + unset($v); + $result = array("total" => $total, "rows" => $list); + + return json($result); + } + $this->view->assign("mimetypeList", \app\common\model\Attachment::getMimetypeList()); + return $this->view->fetch(); + } } diff --git a/application/index/lang/zh-cn/user.php b/application/index/lang/zh-cn/user.php index 6bd21edc..eba327b0 100755 --- a/application/index/lang/zh-cn/user.php +++ b/application/index/lang/zh-cn/user.php @@ -61,4 +61,24 @@ return [ 'Operation failed' => '操作失败', 'Invalid parameters' => '参数不正确', 'Change password failure' => '修改密码失败', + 'All' => '全部', + 'Url' => '物理路径', + 'Imagewidth' => '宽度', + 'Imageheight' => '高度', + 'Imagetype' => '图片类型', + 'Imageframes' => '图片帧数', + 'Preview' => '预览', + 'Filename' => '文件名', + 'Filesize' => '文件大小', + 'Mimetype' => 'Mime类型', + 'Image' => '图片', + 'Audio' => '音频', + 'Video' => '视频', + 'Text' => '文档', + 'Application' => '应用', + 'Zip' => '压缩包', + 'Extparam' => '透传数据', + 'Createtime' => '创建日期', + 'Uploadtime' => '上传时间', + 'Storage' => '存储引擎', ]; diff --git a/application/index/view/user/attachment.html b/application/index/view/user/attachment.html new file mode 100644 index 00000000..2a38b683 --- /dev/null +++ b/application/index/view/user/attachment.html @@ -0,0 +1,61 @@ + +{if $Think.get.dialog} + +{/if} +
+ {if !$Think.get.mimetype||$Think.get.mimetype=='*'} +
+ +
+ {/if} + +
+
+
+
+
+ + + {if request()->get('multiple') == 'true'} + {:__('Choose')} + {/if} +
+ + +
+
+
+ +
+
+
diff --git a/public/assets/js/backend/general/attachment.js b/public/assets/js/backend/general/attachment.js index 0fbde5a0..e536f2d5 100644 --- a/public/assets/js/backend/general/attachment.js +++ b/public/assets/js/backend/general/attachment.js @@ -103,7 +103,7 @@ define(['jquery', 'bootstrap', 'backend', 'form', 'table'], function ($, undefin showExport: false, columns: [ [ - {field: 'state', checkbox: multiple, visible: multiple}, + {field: 'state', checkbox: multiple, visible: multiple, operate:false}, {field: 'id', title: __('Id')}, {field: 'admin_id', title: __('Admin_id'), formatter: Table.api.formatter.search, visible: false}, {field: 'user_id', title: __('User_id'), formatter: Table.api.formatter.search, visible: false}, diff --git a/public/assets/js/frontend/user.js b/public/assets/js/frontend/user.js index ac266854..af8df6a3 100755 --- a/public/assets/js/frontend/user.js +++ b/public/assets/js/frontend/user.js @@ -98,6 +98,95 @@ define(['jquery', 'bootstrap', 'frontend', 'form', 'template'], function ($, und } }); }); + }, + attachment: function () { + require(['table'], function (Table) { + + // 初始化表格参数配置 + Table.api.init({ + extend: { + index_url: 'user/attachment', + } + }); + var urlArr = []; + var multiple = Fast.api.query('multiple'); + multiple = multiple == 'true' ? true : false; + + var table = $("#table"); + + table.on('check.bs.table uncheck.bs.table check-all.bs.table uncheck-all.bs.table', function (e, row) { + if (e.type == 'check' || e.type == 'uncheck') { + row = [row]; + } else { + urlArr = []; + } + $.each(row, function (i, j) { + if (e.type.indexOf("uncheck") > -1) { + var index = urlArr.indexOf(j.url); + if (index > -1) { + urlArr.splice(index, 1); + } + } else { + urlArr.indexOf(j.url) == -1 && urlArr.push(j.url); + } + }); + }); + + // 初始化表格 + table.bootstrapTable({ + url: $.fn.bootstrapTable.defaults.extend.index_url, + sortName: 'id', + showToggle: false, + showExport: false, + columns: [ + [ + {field: 'state', checkbox: multiple, visible: multiple, operate:false}, + {field: 'id', title: __('Id')}, + {field: 'url', title: __('Preview'), formatter: function (value, row, index) { + if (row.mimetype.indexOf("image") > -1) { + var style = row.storage === 'upyun' ? '!/fwfh/120x90' : ''; + return ''; + } else { + return ''; + } + }, operate: false}, + {field: 'filename', title: __('Filename'), formatter: Table.api.formatter.search, operate: 'like'}, + {field: 'imagewidth', title: __('Imagewidth'), operate: false}, + {field: 'imageheight', title: __('Imageheight'), operate: false}, + { + field: 'mimetype', title: __('Mimetype'), operate: 'LIKE %...%', + process: function (value, arg) { + return value.replace(/\*/g, '%'); + } + }, + {field: 'createtime', title: __('Createtime'), formatter: Table.api.formatter.datetime, operate: 'RANGE', addclass: 'datetimerange', sortable: true}, + { + field: 'operate', title: __('Operate'), events: { + 'click .btn-chooseone': function (e, value, row, index) { + Fast.api.close({url: row.url, multiple: multiple}); + }, + }, formatter: function () { + return ' ' + __('Choose') + ''; + } + } + ] + ] + }); + + // 选中多个 + $(document).on("click", ".btn-choose-multi", function () { + Fast.api.close({url: urlArr.join(","), multiple: multiple}); + }); + + // 为表格绑定事件 + Table.api.bindevent(table); + require(['upload'], function (Upload) { + Upload.api.upload($("#toolbar .faupload"), function () { + $(".btn-refresh").trigger("click"); + }); + }); + + }); } }; return Controller; diff --git a/public/assets/js/require-backend.min.js b/public/assets/js/require-backend.min.js index 6d35a978..0a11419e 100644 --- a/public/assets/js/require-backend.min.js +++ b/public/assets/js/require-backend.min.js @@ -10244,7 +10244,8 @@ define('form',['jquery', 'bootstrap', 'upload', 'validator'], function ($, undef var mimetype = $(this).data("mimetype") ? $(this).data("mimetype") : ''; var admin_id = $(this).data("admin-id") ? $(this).data("admin-id") : ''; var user_id = $(this).data("user-id") ? $(this).data("user-id") : ''; - parent.Fast.api.open("general/attachment/select?element_id=" + $(this).attr("id") + "&multiple=" + multiple + "&mimetype=" + mimetype + "&admin_id=" + admin_id + "&user_id=" + user_id, __('Choose'), { + var url = $(this).data("url") ? $(this).data("url") : (typeof Backend !== 'undefined' ? "general/attachment/select" : "user/attachment"); + parent.Fast.api.open(url + "?element_id=" + $(this).attr("id") + "&multiple=" + multiple + "&mimetype=" + mimetype + "&admin_id=" + admin_id + "&user_id=" + user_id, __('Choose'), { callback: function (data) { var button = $("#" + $(that).attr("id")); var maxcount = $(button).data("maxcount"); @@ -11065,12 +11066,6 @@ define("bootstrap-table-jumpto", ["bootstrap-table"], (function (global) { -var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { - return typeof obj; -} : function (obj) { - return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; -}; - (function ($) { 'use strict'; // Reasonable defaults @@ -11263,8 +11258,6 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol }; BootstrapTable.prototype.updateSelected = function () { - var _this = this; - var that = this; _updateSelected.apply(this, Array.prototype.slice.apply(arguments)); @@ -11275,9 +11268,9 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol var $el = $(el); var index = $el.data('index'); var classes = $el.attr('class'); - var inputSelector = '[name="' + _this.options.selectItemName + '"]'; + var inputSelector = '[name="' + that.options.selectItemName + '"]'; var $input = $el.find(inputSelector); - if ((typeof index === 'undefined' ? 'undefined' : _typeof(index)) === undefined) { + if (typeof index === 'undefined') { return; } @@ -11288,16 +11281,16 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol if ($input.length) { $tr.find(inputSelector).prop('checked', $input.prop('checked')); } - if (_this.$selectAll.length) { - $fixedHeader.add($fixedBody).find('[name="btSelectAll"]').prop('checked', _this.$selectAll.prop('checked')); + if (that.$selectAll.length) { + $fixedHeader.add($fixedBody).find('[name="btSelectAll"]').prop('checked', that.$selectAll.prop('checked')); } }; - if (_this.$fixedBody && _this.options.fixedNumber) { - updateFixedBody(_this.$fixedHeader, _this.$fixedBody); + if (that.$fixedBody && that.options.fixedNumber) { + updateFixedBody(that.$fixedHeader, that.$fixedBody); } - if (_this.$fixedBodyRight && _this.options.fixedRightNumber) { - updateFixedBody(_this.$fixedHeaderRight, _this.$fixedBodyRight); + if (that.$fixedBodyRight && that.options.fixedRightNumber) { + updateFixedBody(that.$fixedHeaderRight, that.$fixedBodyRight); } }); }; @@ -11314,7 +11307,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol }; BootstrapTable.prototype.initFixedColumnsHeader = function () { - var _this2 = this; + var that = this; if (this.options.height) { this.needFixedColumns = this.$tableHeader.outerWidth(true) < this.$tableHeader.find('table').outerWidth(true); @@ -11324,10 +11317,10 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol var initFixedHeader = function initFixedHeader($fixedColumns, isRight) { $fixedColumns.find('.fixed-table-header').remove(); - $fixedColumns.append(_this2.$tableHeader.clone(true)); + $fixedColumns.append(that.$tableHeader.clone(true)); $fixedColumns.find('.fixed-table-header').css('margin-right', ""); $fixedColumns.css({ - width: _this2.getFixedColumnsWidth(isRight) + width: that.getFixedColumnsWidth(isRight) }); return $fixedColumns.find('.fixed-table-header'); }; @@ -11351,19 +11344,19 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol }; BootstrapTable.prototype.initFixedColumnsBody = function () { - var _this3 = this; + var that = this; var initFixedBody = function initFixedBody($fixedColumns, $fixedHeader) { $fixedColumns.find('.fixed-table-body').remove(); - $fixedColumns.append(_this3.$tableBody.clone(true)); + $fixedColumns.append(that.$tableBody.clone(true)); var $fixedBody = $fixedColumns.find('.fixed-table-body'); - var tableBody = _this3.$tableBody.get(0); + var tableBody = that.$tableBody.get(0); var scrollHeight = tableBody.scrollWidth > tableBody.clientWidth ? getScrollBarWidth() : 0; var paginationHeight = $(".fixed-table-pagination").height(); - if (typeof _this3.options.height !== 'undefined') paginationHeight = 0; - var height = _this3.$tableContainer.outerHeight(true) - scrollHeight - paginationHeight + 1; + if (typeof that.options.height !== 'undefined') paginationHeight = 0; + var height = that.$tableContainer.outerHeight(true) - scrollHeight - paginationHeight + 1; $fixedColumns.css({ height: height }); @@ -11407,17 +11400,17 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol }; BootstrapTable.prototype.initFixedColumnsEvents = function () { - var _this4 = this; + var that = this; var toggleHover = function toggleHover(e, toggle) { var tr = 'tr[data-index="' + $(e.currentTarget).data('index') + '"]'; - var $trs = _this4.$tableBody.find(tr); + var $trs = that.$tableBody.find(tr); - if (_this4.$fixedBody) { - $trs = $trs.add(_this4.$fixedBody.find(tr)); + if (that.$fixedBody) { + $trs = $trs.add(that.$fixedBody.find(tr)); } - if (_this4.$fixedBodyRight) { - $trs = $trs.add(_this4.$fixedBodyRight.find(tr)); + if (that.$fixedBodyRight) { + $trs = $trs.add(that.$fixedBodyRight.find(tr)); } $trs.css('background-color', toggle ? $(e.currentTarget).css('background-color') : ''); @@ -11432,17 +11425,17 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol var updateScroll = function updateScroll(e, fixedBody) { var normalized = normalizeWheel(e); var deltaY = Math.ceil(normalized.pixelY); - var top = _this4.$tableBody.scrollTop() + deltaY; + var top = that.$tableBody.scrollTop() + deltaY; if (deltaY < 0 && top > 0 || deltaY > 0 && top < fixedBody.scrollHeight - fixedBody.clientHeight) { e.preventDefault(); } - _this4.$tableBody.scrollTop(top); - if (_this4.$fixedBody) { - _this4.$fixedBody.scrollTop(top); + that.$tableBody.scrollTop(top); + if (that.$fixedBody) { + that.$fixedBody.scrollTop(top); } - if (_this4.$fixedBodyRight) { - _this4.$fixedBodyRight.scrollTop(top); + if (that.$fixedBodyRight) { + that.$fixedBodyRight.scrollTop(top); } }; if (this.needFixedColumns && this.options.fixedNumber) { @@ -11453,25 +11446,25 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol }); this.$fixedBody[0].addEventListener(mousewheel, function (e) { //给鼠标滑轮绑定事件 - updateScroll(e, _this4.$fixedBody[0]); + updateScroll(e, that.$fixedBody[0]); }); } //给原本表格绑定scroll事件 $('div.fixed-table-body').off('scroll'); //给所有的body解绑 scroll this.$tableBody.off('scroll').on('scroll', function (e) { - _this4.$tableHeader.scrollLeft(0); - if (_this4.$tableBody.scrollLeft() > 0) { - _this4.$tableHeader.scrollLeft(_this4.$tableBody.scrollLeft()); - if (_this4.options.showFooter && !_this4.options.cardView) { - _this4.$tableFooter.scrollLeft(_this4.$tableBody.scrollLeft()); + that.$tableHeader.scrollLeft(0); + if (that.$tableBody.scrollLeft() > 0) { + that.$tableHeader.scrollLeft(that.$tableBody.scrollLeft()); + if (that.options.showFooter && !that.options.cardView) { + that.$tableFooter.scrollLeft(that.$tableBody.scrollLeft()); } } - var top = _this4.$tableBody.scrollTop(); - if (_this4.$fixedBody) { - _this4.$fixedBody.scrollTop(top); + var top = that.$tableBody.scrollTop(); + if (that.$fixedBody) { + that.$fixedBody.scrollTop(top); } - if (_this4.$fixedBodyRight) { - _this4.$fixedBodyRight.scrollTop(top); + if (that.$fixedBodyRight) { + that.$fixedBodyRight.scrollTop(top); } }); @@ -11483,13 +11476,13 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol }); this.$fixedBodyRight[0].addEventListener(mousewheel, function (e) { //给鼠标滑轮绑定事件 - updateScroll(e, _this4.$fixedBodyRight[0]); + updateScroll(e, that.$fixedBodyRight[0]); }); //给固定表格的checkbox绑定事件 this.$fixedBody && this.$fixedBody.find('input[name="' + this.options.selectItemName + '"]').off("click").on('click', function (e) { e.stopImmediatePropagation(); var index = $(e.target).data("index"); - $(_this4.$selectItem[index]).trigger("click"); + $(that.$selectItem[index]).trigger("click"); }); } @@ -11498,7 +11491,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol var $target = $(e.target); var value = $target.val(); var field = $target.parents('th').data('field'); - var $coreTh = _this4.$header.find('th[data-field="' + field + '"]'); + var $coreTh = that.$header.find('th[data-field="' + field + '"]'); if ($target.is('input')) { $coreTh.find('input').val(value); @@ -11508,7 +11501,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol $select.find('option[value="' + value + '"]').attr('selected', true); } - _this4.triggerSearch(); + that.triggerSearch(); }); } }; diff --git a/public/assets/js/require-form.js b/public/assets/js/require-form.js index 634b5177..0cbbda41 100755 --- a/public/assets/js/require-form.js +++ b/public/assets/js/require-form.js @@ -248,7 +248,8 @@ define(['jquery', 'bootstrap', 'upload', 'validator'], function ($, undefined, U var mimetype = $(this).data("mimetype") ? $(this).data("mimetype") : ''; var admin_id = $(this).data("admin-id") ? $(this).data("admin-id") : ''; var user_id = $(this).data("user-id") ? $(this).data("user-id") : ''; - parent.Fast.api.open("general/attachment/select?element_id=" + $(this).attr("id") + "&multiple=" + multiple + "&mimetype=" + mimetype + "&admin_id=" + admin_id + "&user_id=" + user_id, __('Choose'), { + var url = $(this).data("url") ? $(this).data("url") : (typeof Backend !== 'undefined' ? "general/attachment/select" : "user/attachment"); + parent.Fast.api.open(url + "?element_id=" + $(this).attr("id") + "&multiple=" + multiple + "&mimetype=" + mimetype + "&admin_id=" + admin_id + "&user_id=" + user_id, __('Choose'), { callback: function (data) { var button = $("#" + $(that).attr("id")); var maxcount = $(button).data("maxcount");