## 2.0.3升级到2.0.4 替换/woo目录 替换/public/static/woo目录 替换/config/woo.php文件(重要) 替换/config/wooauth.php文件 替换/config/woo.php文件 复制/app/common/builder目录(重要) composer依赖,请自行composer update升级 升级前做好备份 SQL执行,前缀请自行修改(把`woo_`替换为你的前缀): ``` CREATE TABLE `woo_sensitive` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID', `title` varchar(128) NOT NULL DEFAULT '' COMMENT '标题', `is_verify` tinyint(1) UNSIGNED NOT NULL DEFAULT '0' COMMENT '是否审核', `admin_id` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '管理员ID', `create_time` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '创建日期', `update_time` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '修改日期', `delete_time` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '删除日期', PRIMARY KEY (`id`), KEY `admin_id` (`admin_id`), KEY `delete_time` (`delete_time`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='敏感词' AUTO_INCREMENT=1 ; CREATE TABLE `woo_addon` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID', `name` varchar(64) NOT NULL DEFAULT '' COMMENT '插件目录', `title` varchar(128) NOT NULL DEFAULT '' COMMENT '标题', `author` varchar(64) NOT NULL DEFAULT '' COMMENT '作者', `version` varchar(64) NOT NULL DEFAULT '' COMMENT '版本', `is_verify` tinyint(1) UNSIGNED NOT NULL DEFAULT '0' COMMENT '是否审核', `is_disuninstall` tinyint(1) UNSIGNED NOT NULL DEFAULT '0' COMMENT '禁止卸载', `describe` text NOT NULL COMMENT '插件描述', `admin_id` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '管理员ID', `create_time` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '创建日期', `update_time` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '修改日期', PRIMARY KEY (`id`), KEY `is_verify` (`is_verify`), KEY `admin_id` (`admin_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='插件'; CREATE TABLE `woo_addon_setting` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID', `title` varchar(128) NOT NULL DEFAULT '' COMMENT '标题', `addon_id` int(11) NOT NULL DEFAULT '0' COMMENT '插件ID', `var` varchar(64) NOT NULL DEFAULT '' COMMENT '变量名', `value` text NOT NULL COMMENT '数据', `type` varchar(64) NOT NULL DEFAULT '' COMMENT '输入类型', `options` varchar(512) NOT NULL DEFAULT '' COMMENT '选项', `tip` varchar(128) NOT NULL DEFAULT '' COMMENT '提示', `list_order` int(11) NOT NULL DEFAULT '0' COMMENT '排序权重', `create_time` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '创建日期', `update_time` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '修改日期', PRIMARY KEY (`id`), KEY `list_order` (`list_order`), KEY `addon_id` (`addon_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='插件配置'; DROP TABLE `woo_region`; CREATE TABLE IF NOT EXISTS `woo_region` ( `id` int(11) NOT NULL AUTO_INCREMENT, `parent_id` int(11) NOT NULL DEFAULT '0' COMMENT '父级', `title` varchar(64) NOT NULL DEFAULT '' COMMENT '名称', `code` int(11) NOT NULL DEFAULT '0' COMMENT '代码编号', `pinyin` varchar(64) NOT NULL DEFAULT '' COMMENT '拼音', `jianpin` varchar(64) NOT NULL DEFAULT '' COMMENT '简拼', `first` char(2) NOT NULL DEFAULT '' COMMENT '首字母', `list_order` int(11) NOT NULL DEFAULT '0' COMMENT '排序权重', `children_count` smallint(5) UNSIGNED NOT NULL DEFAULT '0' COMMENT '下级数', `family` varchar(128) NOT NULL DEFAULT '' COMMENT '家族', `level` tinyint(4) NOT NULL DEFAULT '0' COMMENT '层级', `lng` decimal(9,6) NOT NULL DEFAULT '0.000000' COMMENT '经度', `lat` decimal(9,6) NOT NULL DEFAULT '0.000000' COMMENT '纬度', PRIMARY KEY (`id`), KEY `parent_id` (`parent_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='地区' AUTO_INCREMENT=1 ; CREATE TABLE IF NOT EXISTS `woo_request_log` ( `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'ID', `appname` varchar(32) NOT NULL DEFAULT '' COMMENT '应用/插件名', `admin_id` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '管理员ID', `user_id` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '会员ID', `controller` varchar(64) NOT NULL DEFAULT '' COMMENT '控制器', `action` varchar(64) NOT NULL DEFAULT '' COMMENT '方法', `url` varchar(255) NOT NULL DEFAULT '' COMMENT 'URL地址', `method` varchar(32) NOT NULL DEFAULT '' COMMENT '请求方法', `args` varchar(10240) NOT NULL DEFAULT '' COMMENT '数据', `ip` varchar(64) NOT NULL DEFAULT '' COMMENT 'IP地址', `region` varchar(128) NOT NULL DEFAULT '' COMMENT '请求地址', `isp` varchar(64) NOT NULL DEFAULT '' COMMENT '网络ISP', `user_agent` varchar(255) NOT NULL DEFAULT '' COMMENT '客户端', `referer` varchar(255) NOT NULL DEFAULT '' COMMENT '来源', `code` smallint(5) UNSIGNED NOT NULL DEFAULT 0 COMMENT '状态码', `create_time` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '创建日期', `update_time` int(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '修改日期', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='请求日志' AUTO_INCREMENT=1 ; ALTER TABLE `woo_field` CHANGE `is_contribute` `is_contribute` TINYINT NOT NULL DEFAULT '0'; ALTER TABLE `woo_admin_group` ADD `dashboard` VARCHAR(128) NOT NULL DEFAULT '' COMMENT '主面板URL' AFTER `title` ; ALTER TABLE `woo_admin_group` ADD `data_allow` tinyint(4) NOT NULL DEFAULT '0' COMMENT '数据权限' AFTER `dashboard`; ALTER TABLE `woo_admin_group` ADD `custom_data_allow` varchar(128) NOT NULL DEFAULT '' COMMENT '自定义权限' AFTER `dashboard`; ALTER TABLE `woo_admin_login` ADD `region` varchar(128) NOT NULL DEFAULT '' COMMENT '登录地址'; ALTER TABLE `woo_log` ADD `region` varchar(128) NOT NULL DEFAULT '' COMMENT '操作地址'; ALTER TABLE `woo_log` ADD `isp` varchar(64) NOT NULL DEFAULT '' COMMENT '网络ISP'; INSERT INTO `woo_field` (`id`, `field`, `name`, `model_id`, `form`, `form_foreign`, `form_item_attrs`, `form_tag_attrs`, `form_options`, `form_upload`, `form_trigger`, `list`, `list_attrs`, `list_filter`, `list_filter_attrs`, `list_filter_tag_attrs`, `detail`, `detail_attrs`, `validate`, `is_field`, `type`, `length`, `default`, `is_not_null`, `is_unsigned`, `is_ai`, `is_system`, `is_contribute`, `index`, `after`, `admin_id`, `create_time`, `update_time`) VALUES (NULL, 'dashboard', '主面板URL', 5, 'text', '', '', '', '', '', '', '', '', '', '', '', '', '', '', 1, 'VARCHAR', '128', '', 1, 0, 0, 1, 0, '', 'title', 1, 1607440781, 1607440781), (NULL, 'data_allow', '数据权限', 5, 'select', '', '', '', '{\"0\":\"全部数据权限\",\"1\":\"仅本人数据权限\",\"2\":\"本部门数据权限\",\"3\":\"部门及以下数据权限\",\"4\":\"自定义数据权限\"}', '', '{\"4\":\"custom_data_allow\"}', '', '', '', '', '', '', '', '', 1, 'TINYINT', '', '0', 1, 0, 0, 1, 0, '', 'dashboard', 1, 1607517554, 1607527051), (NULL, 'custom_data_allow', '自定义权限', 5, 'xmtree', 'Department', '', '', '', '', '', '0', '', '', '', '', '', '', '', 1, 'VARCHAR', '128', '', 1, 0, 0, 1, 0, '', 'data_allow', 1, 1607517722, 1607519501), (NULL, 'region', '登录地址', 8, 'none', '', '', '', '', '', '', '', '', '', '', '', '', '', '', 1, 'VARCHAR', '128', '', 1, 0, 0, 1, 0, '', 'user_agent', 1, 1608974680, 1608974680), (NULL, 'region', '操作地址', 9, 'none', '', '', '', '', '', '', '', '', '', '', '', '', '', '', 1, 'VARCHAR', '128', '', 1, 0, 0, 1, 0, '', 'ip', 1, 1608974735, 1608974735), (NULL, 'isp', '网络ISP', 9, 'none', '', '', '', '', '', '', '', '', '', '', '', '', '', '', 1, 'VARCHAR', '64', '', 1, 0, 0, 1, 0, '', 'region', 1, 1608974827, 1608974827); ``` 插件栏目自行添加: ![](https://img.kancloud.cn/0c/a0/0ca01102a482cb66cde49c65a00b8684_921x481.png) 如果需要使用地区数据,请导入新版中的data/region.sql文件 ## 2.0.1升级到2.0.2 替换/woo目录,替换/public/woo目录 composer依赖,请自行composer update升级 升级前做好备份