[TOC]
## 2023-06-17 V2.0.0
### 更新内容
1、部门模型调整
2、角色模型调整
3、用户模型调整
4、为了方便开发,列表页和后台一样放出了模型和字段操作的快捷按钮(不过只有商家ID为1(就是系统默认给你建的那个商家)&&超管&&开发模式&&`wooauth`配置的`is_business_model` 为true下可见);模型只保留了编辑,其它功能屏蔽了。
### V1.0.4升级到V2.0.0升级指导
升级前请先备份原项目文件和整个数据库,升级前请先备份原项目文件和整个数据库,升级前请先备份原项目文件和整个数据库。
1、把`business/install`下的目录替换到对应的项目根目录下
2、部门升级
2.1、删除联系人和联系方式字段(非必须)
2.2、新增2个字段
```
ALTER TABLE `woo_business_department` ADD `leader_ids` varchar(128) NOT NULL DEFAULT '' COMMENT '部门领导';
ALTER TABLE `woo_business_department` ADD `is_business` tinyint(1) UNSIGNED NOT NULL DEFAULT '0' COMMENT '管理端登录';
```
2.3、自己找到BusinessDepartment模型ID,把__PARENT_ID__替换了执行:
```
INSERT INTO `woo_field` (`id`, `field`, `name`, `model_id`, `form`, `business_form`, `modify_form`, `business_modify_form`, `form_foreign`, `business_form_foreign`, `form_item_attrs`, `business_form_item_attrs`, `form_tag_attrs`, `business_form_tag_attrs`, `form_options`, `business_form_options`, `form_upload`, `business_form_upload`, `form_trigger`, `business_form_trigger`, `list`, `business_list`, `list_attrs`, `business_list_attrs`, `list_filter`, `business_list_filter`, `list_filter_attrs`, `business_list_filter_attrs`, `list_filter_tag_attrs`, `business_list_filter_tag_attrs`, `detail`, `business_detail`, `detail_attrs`, `business_detail_attrs`, `validate`, `business_validate`, `is_field`, `type`, `length`, `default`, `is_not_null`, `is_unsigned`, `is_ai`, `is_system`, `is_contribute`, `index`, `after`, `admin_id`, `list_order`, `create_time`, `update_time`) VALUES
(NULL, 'leader_ids', '部门领导', __PARENT_ID__, 'relation', 'relation', '', '', 'BusinessMember', 'BusinessMember', '', '', '{\"data-type\":\"checkbox\"}', '{\"data-type\":\"checkbox\"}', '', '', '', '', '', '', 'html', 'html', '{\"1\":\"\",\"width\":\"240\"}', '{\"1\":\"\",\"width\":\"240\"}', '', '', '', '', '', '', '', '', '', '', '', '', 1, 'VARCHAR', '128', '', 1, 0, 0, 1, 0, '', '', 0, 10123, 1686538409, 1686539509),
(NULL, 'is_business', '管理端登录', __PARENT_ID__, 'checker', 'checker', '', '', '', '', '', '', '', '', '', '', '', '', '', '', 'checker', 'checker', '', '', '', '', '', '', '', '', '', '', '', '', '', '', 1, 'TINYINT', '1', '0', 1, 1, 0, 0, 0, '', '', 0, 10124, 1686538442, 1686538442);
```
3、用户升级
3.1、新增三个字段
```
ALTER TABLE `woo_business_member` ADD `idcard` varchar(64) NOT NULL DEFAULT '' COMMENT '身份证';
ALTER TABLE `woo_business_member` ADD `region` varchar(64) NOT NULL DEFAULT '' COMMENT '家庭所在地';
ALTER TABLE `woo_business_member` ADD `address` varchar(64) NOT NULL DEFAULT '' COMMENT '相信地址';
```
3.2、自己找到BusinessMember模型ID,把__PARENT_ID__替换了执行:
```
INSERT INTO `woo_field` (`id`, `field`, `name`, `model_id`, `form`, `business_form`, `modify_form`, `business_modify_form`, `form_foreign`, `business_form_foreign`, `form_item_attrs`, `business_form_item_attrs`, `form_tag_attrs`, `business_form_tag_attrs`, `form_options`, `business_form_options`, `form_upload`, `business_form_upload`, `form_trigger`, `business_form_trigger`, `list`, `business_list`, `list_attrs`, `business_list_attrs`, `list_filter`, `business_list_filter`, `list_filter_attrs`, `business_list_filter_attrs`, `list_filter_tag_attrs`, `business_list_filter_tag_attrs`, `detail`, `business_detail`, `detail_attrs`, `business_detail_attrs`, `validate`, `business_validate`, `is_field`, `type`, `length`, `default`, `is_not_null`, `is_unsigned`, `is_ai`, `is_system`, `is_contribute`, `index`, `after`, `admin_id`, `list_order`, `create_time`, `update_time`) VALUES
(NULL, 'idcard', '身份证', __PARENT_ID__, 'text', 'text', '', '', '', '', '{\"form_group\":\"business\"}', '{\"form_group\":\"business\"}', '', '', '', '', '', '', '', '', '', '', '{\"width\":\"160\"}', '{\"width\":\"160\"}', '1', '1', '', '', '', '', '', '', '', '', '[{\"rule\":\"idCard\",\"args\":\"\",\"on\":\"\",\"message\":\"\"}]', '[{\"rule\":\"idCard\",\"args\":\"\",\"on\":\"\",\"message\":\"\"}]', 1, 'VARCHAR', '64', '', 1, 0, 0, 1, 0, '', '', 0, 528, 1686541177, 1686541601),
(NULL, 'region', '家庭所在地', __PARENT_ID__, 'cascader', 'cascader', '', '', 'Region', 'Region', '{\"form_group\":\"business\"}', '{\"form_group\":\"business\"}', '{\"data-url\":\"true\"}', '{\"data-url\":\"true\"}', '', '', '', '', '', '', '', '', '{\"width\":\"180\"}', '{\"width\":\"180\"}', 'cascader', 'cascader', '', '', '{\"data-url\":\"true\",\"data-nostrict\":\"true\"}', '{\"data-url\":\"true\",\"data-nostrict\":\"true\"}', '', '', '', '', '', '', 1, 'VARCHAR', '64', '', 1, 0, 0, 1, 0, '', '', 0, 542, 1686541336, 1686541524),
(NULL, 'address', '相信地址', __PARENT_ID__, 'text', 'text', '', '', '', '', '{\"form_group\":\"business\"}', '{\"form_group\":\"business\"}', '', '', '', '', '', '', '', '', '0', '0', '', '', '', '', '', '', '', '', '', '', '', '', '', '', 1, 'VARCHAR', '64', '', 1, 0, 0, 1, 0, '', '', 0, 543, 1686541408, 1686541526);
```
4、角色升级
4.1、
```
ALTER TABLE `woo_business_role` ADD `dashboard` varchar(64) NOT NULL DEFAULT '' COMMENT '主面板';
ALTER TABLE `woo_business_role` ADD `is_business` tinyint(1) UNSIGNED NOT NULL DEFAULT '0' COMMENT '管理端登录';
ALTER TABLE `woo_business_role` ADD `is_super` tinyint(1) UNSIGNED NOT NULL DEFAULT '0' COMMENT '是否超管';
```
4.2、自己找到BusinessRole模型ID,把__PARENT_ID__替换了执行:
```
INSERT INTO `woo_field` (`id`, `field`, `name`, `model_id`, `form`, `business_form`, `modify_form`, `business_modify_form`, `form_foreign`, `business_form_foreign`, `form_item_attrs`, `business_form_item_attrs`, `form_tag_attrs`, `business_form_tag_attrs`, `form_options`, `business_form_options`, `form_upload`, `business_form_upload`, `form_trigger`, `business_form_trigger`, `list`, `business_list`, `list_attrs`, `business_list_attrs`, `list_filter`, `business_list_filter`, `list_filter_attrs`, `business_list_filter_attrs`, `list_filter_tag_attrs`, `business_list_filter_tag_attrs`, `detail`, `business_detail`, `detail_attrs`, `business_detail_attrs`, `validate`, `business_validate`, `is_field`, `type`, `length`, `default`, `is_not_null`, `is_unsigned`, `is_ai`, `is_system`, `is_contribute`, `index`, `after`, `admin_id`, `list_order`, `create_time`, `update_time`) VALUES
(NULL, 'dashboard', '主面板', __PARENT_ID__, 'text', 'text', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '{\"width\":\"200\"}', '{\"width\":\"200\"}', '', '', '', '', '', '', '', '', '', '', '', '', 1, 'VARCHAR', '64', '', 1, 0, 0, 1, 0, '', '', 1, 516, 1686530939, 1686535912),
(NULL, 'is_business', '管理端登录', __PARENT_ID__, 'checker', 'checker', '', '', '', '', '', '', '', '', '', '', '', '', '', '', 'checker', 'checker', '', '', '', '', '', '', '', '', '', '', '', '', '', '', 1, 'TINYINT', '1', '0', 1, 1, 0, 1, 0, '', '', 1, 517, 1686530986, 1686534406),
(NULL, 'is_super', '是否超管', __PARENT_ID__, 'none', 'none', '', '', '', '', '', '', '', '', '', '', '', '', '', '', 'checker', '0', '', '', '', '', '', '', '', '', '', '0', '', '', '', '', 1, 'TINYINT', '1', '0', 1, 1, 0, 1, 0, '', '', 0, 518, 1686534254, 1686535857);
```
5、新增了几个系统设置:
```
INSERT INTO `woo_business_setting` (`id`, `title`, `business_setting_group_id`, `var`, `value`, `type`, `options`, `tip`, `list_order`, `admin_id`, `is_js_var`, `create_time`, `update_time`, `delete_time`, `is_business`, `is_business_member`) VALUES
(NULL, '选项卡样式', 1, 'admin_tab_style', 'layui-tab-brief', 'select', '{\"layui-tab-brief\":\"简洁风格\",\"layui-tab-default\":\"凹型风格\",\"layui-tab-card\":\"卡片风格\"}', '', 24, 1, 0, 1686542454, 1686542495, 0, 1, 1),
(NULL, '列表项工具按钮风格', 2, 'table_item_toolbar_style', 'text', 'select', '{\"button\":\"按钮风格(默认)\",\"text\":\"文本不带图标风格\",\"text_icon\":\"文本可带图标风格\"}', '', 25, 1, 0, 1686547449, 1686547615, 0, 1, 1),
(NULL, '列表项文本按钮类名', 2, 'table_item_toolbar_text_class', '', 'text', '', '可通过控制类名实现按钮颜色和样式的控制;类名\"woo-theme-color\"实现按钮颜色随主题', 26, 1, 0, 1686547523, 1686547523, 0, 1, 1),
(NULL, '表格全局默认高度', 2, 'table_default_height', '0', 'number', '', '如不设置默认高度,请填写为0', 27, 1, 0, 1686547547, 1686547615, 0, 1, 1),
(NULL, '表格自动计算高度', 2, 'table_is_inner_height', '0', 'checker', '', '当表格没有设置高度、最大高度、非移动端时有效', 28, 1, 1, 1686581934, 1686581953, 0, 1, 1);
```
6、用户新增密码修改的表单场景
自己找到BusinessMember模型ID,把8888替换了执行:
```
INSERT INTO `woo_form_scene` (`id`, `model_id`, `title`, `is_verify`, `list_order`, `create_time`, `update_time`, `icon`, `hover`, `where`, `action`, `where_type`, `is_btn`, `var`, `fields`, `parent`, `app`, `attrs`, `class`, `page_title`, `success_message`, `page_tip`) VALUES
(NULL, 8888, '', 1, 72, 1686548111, 1686548692, 'layui-icon-password', '密码', '', 'password', '', 1, 'password', '[{\"field\":\"password\",\"elem\":\"password\",\"more_attrs\":\"{\\\"tip\\\":\\\"\\\",\\\"rsa\\\":\\\"true\\\"}\",\"validate\":\"{\\\"require\\\":\\\"\\\",\\\"confirm\\\":\\\"repassword\\\"}\"},{\"field\":\"repassword\",\"elem\":\"password\",\"more_attrs\":\"{\\\"name\\\":\\\"确认密码\\\",\\\"attrs\\\":\\\"{\\\\\\\"lay-affix\\\\\\\":\\\\\\\"eye\\\\\\\"}\\\",\\\"rsa\\\":\\\"true\\\"}\",\"validate\":\"{\\\"require\\\":\\\"\\\",\\\"confirm\\\":\\\"password\\\"}\"}]', '', '[\"admin\",\"business\"]', '', 'btn-37', '修改密码', '密码修改成功', '');
```