You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
wkcrm/public/sql/update_sql_20210510.sql

159 lines
41 KiB

4 years ago
-- 版本11.0.3
ALTER TABLE `5kcrm_crm_leads` ADD COLUMN `email` varchar(64) DEFAULT NULL COMMENT '邮箱地址';
INSERT INTO `5kcrm_admin_field` (`types`, `types_id`, `field`, `name`, `form_type`, `default_value`, `max_length`, `is_unique`, `is_null`, `input_tips`, `setting`, `order_id`, `operating`, `create_time`, `update_time`, `type`, `relevant`, `is_hidden`) VALUES ('crm_leads', 0, 'email', '电子邮箱', 'email', '', 0, 0, 0, '', NULL, 10, 1, 1616464748, 1616464748, 2, NULL, 0);
ALTER TABLE `5kcrm_oa_log` MODIFY COLUMN `save_receivables` decimal(18,2) NOT NULL DEFAULT 0.00 COMMENT '每日新增回款';
ALTER TABLE `5kcrm_crm_printing_record` ADD COLUMN `content` text NOT NULL COMMENT '打印内容' AFTER `template_id`;
ALTER TABLE `5kcrm_work` ADD COLUMN `is_follow` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '关注1关注';
DROP TABLE IF EXISTS `5kcrm_admin_printing_data`;
CREATE TABLE `5kcrm_admin_printing_data` (
`data_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`key` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '文件key',
`content` text CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '文件内容',
`user_id` int(10) UNSIGNED NOT NULL COMMENT '用户ID',
`type` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '类型word、pdf',
`create_time` int(10) UNSIGNED NOT NULL COMMENT '创建时间',
PRIMARY KEY (`data_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '打印文件表' ROW_FORMAT = Dynamic;
DROP TABLE IF EXISTS `5kcrm_work_lable_order`;
CREATE TABLE `5kcrm_work_lable_order` (
`order_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`lable_id` int(10) UNSIGNED NOT NULL COMMENT '标签ID',
`user_id` int(10) UNSIGNED NOT NULL COMMENT '用户ID',
`order` int(10) UNSIGNED NOT NULL COMMENT '排序',
PRIMARY KEY (`order_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '标签排序表' ROW_FORMAT = Dynamic;
ALTER TABLE `5kcrm_crm_customer` ADD COLUMN `before_owner_user_id` int(10) unsigned DEFAULT 0 COMMENT '前负责人';
ALTER TABLE `5kcrm_crm_customer` ADD COLUMN `into_pool_time` int(10) unsigned DEFAULT 0 COMMENT '进入公海时间';
ALTER TABLE `5kcrm_admin_operation_log` ADD COLUMN `action_name` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '操作';
ALTER TABLE `5kcrm_admin_operation_log` ADD COLUMN `target_name` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '被操作对象';
UPDATE `5kcrm_admin_rule` SET `status` = 1 WHERE `types` = 2 AND `title` = '打印' AND `level` = 3;
ALTER TABLE `5kcrm_admin_printing` MODIFY COLUMN `type` tinyint(1) NOT NULL COMMENT '打印类型5商机6合同7回款';
INSERT INTO `5kcrm_admin_printing` VALUES (1, 5, '李四', '合同条款打印模板', 6, '{\"data\":\"<p style=\\\"text-align: center; line-height: 1; margin-bottom: 15px;\\\"><span style=\\\"font-size: 36px; font-family: simsun, serif;\\\">***\\u6709\\u9650\\u516c\\u53f8<\\/span><\\/p>\\n<p style=\\\"text-align: center; line-height: 1; margin-bottom: 15px;\\\"><span style=\\\"font-size: 36px; font-family: simsun, serif;\\\">\\u9500\\u552e\\u5408\\u540c<\\/span><\\/p>\\n<p style=\\\"text-align: right;\\\"><span style=\\\"font-size: 14px; font-family: simsun, serif; color: #525151;\\\">\\u5408\\u540c\\u7f16\\u53f7\\uff1a<span class=\\\"wk-print-tag-wukong wk-tiny-color--contract\\\" contenteditable=\\\"true\\\" data-wk-tag=\\\"contract.num\\\">{\\u5408\\u540c\\u7f16\\u53f7}<\\/span><\\/span><\\/p>\\n<p>\\u7532\\u65b9\\uff1a<span class=\\\"wk-print-tag-wukong wk-tiny-color--customer\\\" contenteditable=\\\"true\\\" data-wk-tag=\\\"customer.name\\\">{\\u5ba2\\u6237\\u540d\\u79f0}<\\/span><\\/p>\\n<p>\\u4e59\\u65b9\\uff1a<span style=\\\"font-size: 14px; font-family: simsun, serif;\\\">\\u90d1\\u5dde\\u5361\\u5361\\u7f57\\u7279\\u8f6f\\u4ef6\\u79d1\\u6280\\u6709\\u9650\\u516c\\u53f8<\\/span><\\/p>\\n<p>&nbsp;<\\/p>\\n<p style=\\\"line-height: 1.75;\\\"><span style=\\\"font-size: 14px; font-family: simsun, serif;\\\">\\u7532\\u4e59\\u53cc\\u65b9\\u672c\\u7740\\u76f8\\u4e92\\u4fe1\\u4efb\\uff0c\\u771f\\u8bda\\u5408\\u4f5c\\u7684\\u539f\\u5219\\uff0c\\u7ecf\\u53cc\\u65b9\\u53cb\\u597d\\u534f\\u5546\\uff0c\\u5c31\\u4e59\\u65b9\\u4e3a\\u7532\\u65b9\\u63d0\\u4f9b\\u7279\\u5b9a\\u670d\\u52a1\\u8fbe\\u6210\\u4e00\\u81f4\\u610f\\u89c1\\uff0c\\u7279\\u7b7e\\u8ba2\\u672c\\u5408\\u540c\\u3002<\\/span><\\/p>\\n<p style=\\\"line-height: 1.75;\\\"><span style=\\\"font-size: 14px; font-family: simsun, serif;\\\"><strong>\\u4e00\\u3001\\u670d\\u52a1\\u5185\\u5bb9<\\/strong><\\/span><\\/p>\\n<p style=\\\"line-height: 1.75;\\\"><span style=\\\"font-size: 14px; font-family: simsun, serif;\\\">1\\u3001\\u4e59\\u65b9\\u540c\\u610f\\u5411\\u7532\\u65b9\\u63d0\\u4f9b\\u7684\\u7279\\u5b9a\\u670d\\u52a1\\u3002\\u670d\\u52a1\\u7684\\u5185\\u5bb9\\u7684\\u6807\\u51c6\\u89c1\\u9644\\u4ef6A\\u3002<\\/span><\\/p>\\n<p style=\\\"line-height: 1.75;\\\"><span style=\\\"font-size: 14px; font-family: simsun, serif;\\\">2\\u3001\\u5982\\u679c\\u4e59\\u65b9\\u5728\\u5de5\\u4f5c\\u4e2d\\u56e0\\u81ea\\u8eab\\u8fc7\\u9519\\u800c\\u53d1\\u751f\\u4efb\\u4f55\\u9519\\u8bef\\u6216\\u9057\\u6f0f\\uff0c\\u4e59\\u65b9\\u5e94\\u65e0\\u6761\\u4ef6\\u66f4\\u6b63\\uff0c\\u800c\\u4e0d\\u53e6\\u5916\\u6536\\u8d39\\uff0c\\u5e76\\u5bf9\\u56e0\\u6b64\\u800c\\u5bf9\\u7532\\u65b9\\u9020\\u6210\\u7684\\u635f\\u5931\\u627f\\u62c5\\u8d54\\u507f\\u8d23\\u4efb\\uff0c\\u8d54\\u507f\\u4ee5\\u9644\\u4ef6A\\u6240\\u8f7d\\u660e\\u7684\\u8be5\\u9879\\u670d\\u52a1\\u5185\\u5bb9\\u5bf9\\u5e94\\u4e4b\\u670d\\u52a1\\u8d39\\u4e3a\\u9650\\u3002\\u82e5\\u56e0\\u7532\\u65b9\\u539f\\u56e0\\u9020\\u6210\\u5de5\\u4f5c\\u7684\\u5ef6\\u8bef\\uff0c\\u5c06\\u7531\\u7532\\u65b9\\u627f\\u62c5\\u76f8\\u5e94\\u7684\\u635f\\u5931\\u3002<\\/span><\\/p>\\n<p style=\\\"line-height: 1.75;\\\"><span style=\\\"font-size: 14px; font-family: simsun, serif;\\\">3\\u3001\\u4e59\\u65b9\\u7684\\u670d\\u52a1\\u627f\\u8bfa\\uff1a<\\/span><\\/p>\\n<p style=\\\"line-height: 1.75;\\\"><span style=\\\"font-size: 14px; font-family: simsun, serif;\\\">&nbsp; &nbsp; 1\\uff09\\u4e59\\u65b9\\u63a5\\u5230\\u7532\\u65b9\\u901a\\u8fc7\\u7535\\u8bdd\\u3001\\u4fe1\\u51fd\\u4f20\\u771f\\u3001\\u7535\\u5b50\\u90ae\\u4ef6\\u3001\\u7f51\\u4e0a\\u63d0\\u4ea4\\u7b49\\u65b9\\u5f0f\\u63d0\\u51fa\\u5173\\u4e8e\\u9644\\u4ef6A\\u6240\\u5217\\u670d\\u52a1\\u7684\\u8bf7\\u6c42\\u540e\\uff0c\\u5728\\u4e24\\u4e2a\\u6709\\u6548\\u5de5\\u4f5c\\u65e5\\u5185\\u7ed9\\u4e88\\u54cd\\u5e94\\u5e76\\u63d0\\u4f9b\\u670d\\u52a1\\u3002<\\/span><\\/p>\\n<p style=\\\"line-height: 1.75;\\\"><span style=\\\"font-size: 14px; font-family: simsun, serif;\\\">&nbsp; &nbsp; 2\\uff09\\u4e59\\u65b9\\u63d0\\u4f9b\\u7ed9\\u7532\\u65b9\\u7684\\u670d\\u52a1\\uff0c\\u5fc5\\u987b\\u6
INSERT INTO `5kcrm_admin_printing` VALUES (2, 5, '李四', '合同订单打印模板', 6, '{\"data\":\"<p style=\\\"text-align: center;\\\"><span style=\\\"font-size: 36px; font-family: simsun, serif;\\\">\\u5408\\u540c\\u8ba2\\u5355<\\/span><\\/p>\\n<p style=\\\"text-align: right;\\\">\\u5408\\u540c\\u7f16\\u53f7\\uff1a<span class=\\\"wk-print-tag-wukong wk-tiny-color--contract\\\" contenteditable=\\\"false\\\" data-wk-tag=\\\"contract.num\\\">{\\u5408\\u540c\\u7f16\\u53f7}<\\/span><\\/p>\\n<table style=\\\"border-collapse: collapse; width: 100%; height: 95px;\\\" border=\\\"1\\\">\\n<tbody>\\n<tr style=\\\"height: 25px;\\\">\\n<td style=\\\"width: 50%; height: 19px;\\\">\\u5408\\u540c\\u540d\\u79f0\\uff1a<span class=\\\"wk-print-tag-wukong wk-tiny-color--contract\\\" contenteditable=\\\"false\\\" data-wk-tag=\\\"contract.name\\\">{\\u5408\\u540c\\u540d\\u79f0}<\\/span><\\/td>\\n<td style=\\\"width: 50%; height: 19px;\\\">\\u5ba2\\u6237\\u540d\\u79f0\\uff1a<span class=\\\"wk-print-tag-wukong wk-tiny-color--customer\\\" contenteditable=\\\"false\\\" data-wk-tag=\\\"customer.name\\\">{\\u5ba2\\u6237\\u540d\\u79f0}<\\/span><\\/td>\\n<\\/tr>\\n<tr style=\\\"height: 25px;\\\">\\n<td style=\\\"width: 50%; height: 19px;\\\">\\u5408\\u540c\\u603b\\u91d1\\u989d\\uff1a<span class=\\\"wk-print-tag-wukong wk-tiny-color--contract\\\" contenteditable=\\\"false\\\" data-wk-tag=\\\"contract.money\\\">{\\u5408\\u540c\\u91d1\\u989d}<\\/span><\\/td>\\n<td style=\\\"width: 50%; height: 19px;\\\">\\u8d1f\\u8d23\\u4eba\\uff1a<span class=\\\"wk-print-tag-wukong wk-tiny-color--contract\\\" contenteditable=\\\"false\\\" data-wk-tag=\\\"contract.owner_user_id\\\">{\\u8d1f\\u8d23\\u4eba}<\\/span><\\/td>\\n<\\/tr>\\n<tr style=\\\"height: 25px;\\\">\\n<td style=\\\"width: 50%; height: 19px;\\\">\\u76f8\\u5173\\u5546\\u673a\\uff1a<span class=\\\"wk-print-tag-wukong wk-tiny-color--contract\\\" contenteditable=\\\"false\\\" data-wk-tag=\\\"contract.business_id\\\">{\\u5546\\u673a\\u540d\\u79f0}<\\/span><\\/td>\\n<td style=\\\"width: 50%; height: 19px;\\\">\\u7b7e\\u8ba2\\u65f6\\u95f4\\uff1a<span class=\\\"wk-print-tag-wukong wk-tiny-color--contract\\\" contenteditable=\\\"false\\\" data-wk-tag=\\\"contract.order_date\\\">{\\u4e0b\\u5355\\u65f6\\u95f4}<\\/span><\\/td>\\n<\\/tr>\\n<tr style=\\\"height: 25px;\\\">\\n<td style=\\\"width: 50%; height: 19px;\\\">\\u5f00\\u59cb\\u65f6\\u95f4\\uff1a<span class=\\\"wk-print-tag-wukong wk-tiny-color--contract\\\" contenteditable=\\\"false\\\" data-wk-tag=\\\"contract.start_time\\\">{\\u5408\\u540c\\u5f00\\u59cb\\u65f6\\u95f4}<\\/span><\\/td>\\n<td style=\\\"width: 50%; height: 19px;\\\">\\u7ed3\\u675f\\u65f6\\u95f4\\uff1a<span class=\\\"wk-print-tag-wukong wk-tiny-color--contract\\\" contenteditable=\\\"false\\\" data-wk-tag=\\\"contract.end_time\\\">{\\u5408\\u540c\\u5230\\u671f\\u65f6\\u95f4}<\\/span><\\/td>\\n<\\/tr>\\n<tr style=\\\"height: 25px;\\\">\\n<td style=\\\"width: 50%; height: 19px;\\\">\\u5907\\u6ce8\\uff1a<span class=\\\"wk-print-tag-wukong wk-tiny-color--contract\\\" contenteditable=\\\"false\\\" data-wk-tag=\\\"contract.remark\\\">{\\u5907\\u6ce8}<\\/span><\\/td>\\n<td style=\\\"width: 50%; height: 19px;\\\">&nbsp;<\\/td>\\n<\\/tr>\\n<\\/tbody>\\n<\\/table>\\n<p>&nbsp;<\\/p>\\n<p>&nbsp;<\\/p>\\n<p>\\u4ea7\\u54c1\\u660e\\u7ec6\\uff1a<\\/p>\\n<table style=\\\"border-collapse: collapse; width: 100%;\\\" border=\\\"1\\\" data-wk-table-tag=\\\"table\\\">\\n<tbody>\\n<tr data-wk-table-tr-tag=\\\"header\\\">\\n<td data-wk-table-td-tag=\\\"name\\\">\\u4ea7\\u54c1\\u540d\\u79f0<\\/td>\\n<td data-wk-table-td-tag=\\\"name\\\">\\u4ea7\\u54c1\\u7c7b\\u522b<\\/td>\\n<td data-wk-table-td-tag=\\\"name\\\">\\u5355\\u4f4d<\\/td>\\n<td data-wk-table-td-tag=\\\"name\\\">\\u6807\\u51c6\\u4ef7\\u683c<\\/td>\\n<td data-wk-table-td-tag=\\\"name\\\">\\u552e\\u4ef7<\\/td>\\n<td data-wk-table-td-tag=\\\"name\\\">\\u6570\\u91cf<\\/td>\\n<td data-wk-table-td-tag=\\\"name\\\">\\u6298\\u6263<\\/td>\\n<td data-wk-table-td-tag=\\\"name\\\">\\u5408\\u8ba1<\\/td>\\n<\\/tr>\\n<tr data-wk-table-tr-tag=\\\"value\\\">\\n<td data-wk
INSERT INTO `5kcrm_admin_printing` VALUES (3, 5, '李四', '商机打印模板', 5, '{\"data\":\"<p style=\\\"text-align: center; line-height: 1; margin-bottom: 15px;\\\"><span style=\\\"font-size: 36px; font-family: simsun, serif;\\\">***\\u6709\\u9650\\u516c\\u53f8<\\/span><\\/p>\\n<p style=\\\"text-align: center; line-height: 1; margin-bottom: 15px;\\\"><span style=\\\"font-size: 36px; font-family: simsun, serif;\\\">\\u5546\\u673a<\\/span><\\/p>\\n<table style=\\\"border-collapse: collapse; width: 100%;\\\" border=\\\"1\\\">\\n<tbody>\\n<tr style=\\\"height: 25px;\\\">\\n<td style=\\\"width: 50%;\\\">\\u5546\\u673a\\u540d\\u79f0\\uff1a<span class=\\\"wk-print-tag-wukong wk-tiny-color--business\\\" contenteditable=\\\"false\\\" data-wk-tag=\\\"business.name\\\">{\\u5546\\u673a\\u540d\\u79f0}<\\/span><\\/td>\\n<td style=\\\"width: 50%;\\\">\\u5ba2\\u6237\\u540d\\u79f0\\uff1a<span class=\\\"wk-print-tag-wukong wk-tiny-color--customer\\\" contenteditable=\\\"false\\\" data-wk-tag=\\\"customer.name\\\">{\\u5ba2\\u6237\\u540d\\u79f0}<\\/span><\\/td>\\n<\\/tr>\\n<tr style=\\\"height: 25px;\\\">\\n<td style=\\\"width: 50%;\\\">\\u5546\\u673a\\u72b6\\u6001\\u7ec4\\uff1a<span class=\\\"wk-print-tag-wukong wk-tiny-color--business\\\" contenteditable=\\\"false\\\" data-wk-tag=\\\"business.type_id\\\">{\\u5546\\u673a\\u72b6\\u6001\\u7ec4}<\\/span><\\/td>\\n<td style=\\\"width: 50%;\\\">\\u5546\\u673a\\u9636\\u6bb5\\uff1a<span class=\\\"wk-print-tag-wukong wk-tiny-color--business\\\" contenteditable=\\\"false\\\" data-wk-tag=\\\"business.status_id\\\">{\\u5546\\u673a\\u9636\\u6bb5}<\\/span><\\/td>\\n<\\/tr>\\n<tr style=\\\"height: 25px;\\\">\\n<td style=\\\"width: 50%;\\\">\\u9884\\u8ba1\\u6210\\u4ea4\\u65f6\\u95f4\\uff1a<span class=\\\"wk-print-tag-wukong wk-tiny-color--business\\\" contenteditable=\\\"false\\\" data-wk-tag=\\\"business.deal_date\\\">{\\u9884\\u8ba1\\u6210\\u4ea4\\u65e5\\u671f}<\\/span><\\/td>\\n<td style=\\\"width: 50%;\\\">\\u5546\\u673a\\u91d1\\u989d\\uff08\\u5143\\uff09\\uff1a<span class=\\\"wk-print-tag-wukong wk-tiny-color--business\\\" contenteditable=\\\"false\\\" data-wk-tag=\\\"business.money\\\">{\\u5546\\u673a\\u91d1\\u989d}<\\/span><\\/td>\\n<\\/tr>\\n<tr style=\\\"height: 25px;\\\">\\n<td style=\\\"width: 50%;\\\">\\u8d1f\\u8d23\\u4eba\\uff1a<span class=\\\"wk-print-tag-wukong wk-tiny-color--business\\\" contenteditable=\\\"false\\\" data-wk-tag=\\\"business.owner_user_id\\\">{\\u8d1f\\u8d23\\u4eba}<\\/span><\\/td>\\n<td style=\\\"width: 50%;\\\">&nbsp;<\\/td>\\n<\\/tr>\\n<\\/tbody>\\n<\\/table>\\n<p>&nbsp;<\\/p>\\n<p>&nbsp;<\\/p>\\n<p>\\u4ea7\\u54c1\\u660e\\u7ec6\\uff1a<\\/p>\\n<table style=\\\"border-collapse: collapse; width: 100%;\\\" border=\\\"1\\\" data-wk-table-tag=\\\"table\\\">\\n<tbody>\\n<tr data-wk-table-tr-tag=\\\"header\\\">\\n<td data-wk-table-td-tag=\\\"name\\\">\\u4ea7\\u54c1\\u540d\\u79f0<\\/td>\\n<td data-wk-table-td-tag=\\\"name\\\">\\u4ea7\\u54c1\\u7c7b\\u522b<\\/td>\\n<td data-wk-table-td-tag=\\\"name\\\">\\u5355\\u4f4d<\\/td>\\n<td data-wk-table-td-tag=\\\"name\\\">\\u6807\\u51c6\\u4ef7\\u683c<\\/td>\\n<td data-wk-table-td-tag=\\\"name\\\">\\u552e\\u4ef7<\\/td>\\n<td data-wk-table-td-tag=\\\"name\\\">\\u6570\\u91cf<\\/td>\\n<td data-wk-table-td-tag=\\\"name\\\">\\u6298\\u6263<\\/td>\\n<td data-wk-table-td-tag=\\\"name\\\">\\u5408\\u8ba1<\\/td>\\n<\\/tr>\\n<tr data-wk-table-tr-tag=\\\"value\\\">\\n<td data-wk-table-td-tag=\\\"value\\\"><span class=\\\"wk-print-tag-wukong wk-tiny-color--product\\\" contenteditable=\\\"false\\\" data-wk-table-value-tag=\\\"product.name\\\">{\\u4ea7\\u54c1\\u540d\\u79f0}<\\/span><\\/td>\\n<td data-wk-table-td-tag=\\\"value\\\"><span class=\\\"wk-print-tag-wukong wk-tiny-color--product\\\" contenteditable=\\\"false\\\" data-wk-table-value-tag=\\\"product.category_id\\\">{\\u4ea7\\u54c1\\u7c7b\\u522b}<\\/span><\\/td>\\n<td data-wk-table-td-tag=\\\"value\\\"><span class=\\\"wk-print-tag-wukong wk-tiny-color--product\\\" contenteditable=\\\"false\\\" data-wk-table-value-tag=\\\"product.unit\\\">{\\u5355\\u4f4d}<\\/span><\\/td>\\n<td data-wk-table-td
INSERT INTO `5kcrm_admin_printing` VALUES (4, 5, '李四', '回款打印模板', 7, '{\"data\":\"<p style=\\\"text-align: center; line-height: 1; margin-bottom: 15px;\\\"><span style=\\\"font-size: 36px; font-family: simsun, serif;\\\">***\\u6709\\u9650\\u516c\\u53f8<\\/span><\\/p>\\n<p style=\\\"text-align: center; line-height: 1; margin-bottom: 15px;\\\"><span style=\\\"font-size: 36px; font-family: simsun, serif;\\\">\\u56de\\u6b3e\\u5355<\\/span><\\/p>\\n<table style=\\\"border-collapse: collapse; width: 100%; height: 95px;\\\" border=\\\"1\\\">\\n<tbody>\\n<tr style=\\\"height: 25px;\\\">\\n<td style=\\\"width: 50%; height: 19px;\\\">\\u5ba2\\u6237\\u540d\\u79f0\\uff1a<span class=\\\"wk-print-tag-wukong wk-tiny-color--receivables\\\" contenteditable=\\\"false\\\" data-wk-tag=\\\"receivables.customer_id\\\">{\\u5ba2\\u6237\\u540d\\u79f0}<\\/span><\\/td>\\n<td style=\\\"width: 50%; height: 19px;\\\">\\u56de\\u6b3e\\u7f16\\u53f7\\uff1a<span class=\\\"wk-print-tag-wukong wk-tiny-color--receivables\\\" contenteditable=\\\"false\\\" data-wk-tag=\\\"receivables.number\\\">{\\u56de\\u6b3e\\u7f16\\u53f7}<\\/span><\\/td>\\n<\\/tr>\\n<tr style=\\\"height: 25px;\\\">\\n<td style=\\\"width: 50%; height: 19px;\\\">\\u56de\\u6b3e\\u65e5\\u671f\\uff1a<span class=\\\"wk-print-tag-wukong wk-tiny-color--receivables\\\" contenteditable=\\\"false\\\" data-wk-tag=\\\"receivables.return_time\\\">{\\u56de\\u6b3e\\u65e5\\u671f}<\\/span><\\/td>\\n<td style=\\\"width: 50%; height: 19px;\\\">\\u56de\\u6b3e\\u65b9\\u5f0f\\uff1a<span class=\\\"wk-print-tag-wukong wk-tiny-color--receivables\\\" contenteditable=\\\"false\\\" data-wk-tag=\\\"receivables.return_type\\\">{\\u56de\\u6b3e\\u65b9\\u5f0f}<\\/span><\\/td>\\n<\\/tr>\\n<tr style=\\\"height: 25px;\\\">\\n<td style=\\\"width: 50%; height: 19px;\\\">\\u56de\\u6b3e\\u671f\\u6570\\uff1a<span class=\\\"wk-print-tag-wukong wk-tiny-color--receivables\\\" contenteditable=\\\"false\\\" data-wk-tag=\\\"receivables.plan_id\\\">{\\u671f\\u6570}<\\/span><\\/td>\\n<td style=\\\"width: 50%; height: 19px;\\\">\\u56de\\u6b3e\\u91d1\\u989d\\uff08\\u5143\\uff09\\uff1a<span class=\\\"wk-print-tag-wukong wk-tiny-color--receivables\\\" contenteditable=\\\"false\\\" data-wk-tag=\\\"receivables.money\\\">{\\u56de\\u6b3e\\u91d1\\u989d}<\\/span><\\/td>\\n<\\/tr>\\n<tr style=\\\"height: 25px;\\\">\\n<td style=\\\"width: 50%; height: 19px;\\\">\\u8d1f\\u8d23\\u4eba\\uff1a<span class=\\\"wk-print-tag-wukong wk-tiny-color--receivables\\\" contenteditable=\\\"true\\\" data-wk-tag=\\\"receivables.owner_user_id\\\">{\\u8d1f\\u8d23\\u4eba}<\\/span><\\/td>\\n<td style=\\\"width: 50%; height: 19px;\\\">&nbsp;<\\/td>\\n<\\/tr>\\n<tr style=\\\"height: 25px;\\\">\\n<td style=\\\"width: 50%; height: 19px;\\\" colspan=\\\"2\\\">\\u5907\\u6ce8\\uff1a<span class=\\\"wk-print-tag-wukong wk-tiny-color--receivables\\\" contenteditable=\\\"true\\\" data-wk-tag=\\\"receivables.remark\\\">{\\u5907\\u6ce8}<\\/span><\\/td>\\n<\\/tr>\\n<\\/tbody>\\n<\\/table>\\n<p>&nbsp;<\\/p>\"}', 1617869632, 1617869632);
DELETE FROM `5kcrm_admin_rule` WHERE `types` = 0 AND `title` = '登录日志' AND `name` = 'loginRecord' AND `level` = 2 AND `pid` = 105;
DELETE FROM `5kcrm_admin_rule` WHERE `types` = 0 AND `title` = '查看' AND `name` = 'index' AND `level` = 3 AND `pid` = 151;
INSERT INTO `5kcrm_admin_rule` VALUES ('260', '0', '系统日志', 'adminLog', '2', '105', '1');
INSERT INTO `5kcrm_admin_rule` VALUES ('261', '0', '数据操作日志', 'actionRecord', '3', '260', '1');
INSERT INTO `5kcrm_admin_rule` VALUES ('262', '0', '系统操作日志', 'systemLog', '3', '260', '1');
INSERT INTO `5kcrm_admin_rule` VALUES ('263', '0', '登录日志', 'loginLog', '3', '260', '1');
CREATE TABLE `5kcrm_admin_rule_temporary` AS (SELECT `id` FROM `5kcrm_admin_rule` WHERE `types` = 2 AND `title` = '公海管理' AND `level` = 2 AND `pid` = 1);
DELETE FROM `5kcrm_admin_rule` WHERE `pid` IN (SELECT `id` FROM `5kcrm_admin_rule_temporary`);
DELETE FROM `5kcrm_admin_rule` WHERE `types` = 2 AND `title` = '公海管理' AND `level` = 2 AND `pid` = 1;
DROP TABLE IF EXISTS `5kcrm_admin_rule_temporary`;
ALTER TABLE `5kcrm_crm_customer` ADD COLUMN `pool_remain` tinyint(1) NOT NULL DEFAULT 0 COMMENT '代办事项待进入公海1已处理0未处理';
DELETE FROM `5kcrm_crm_config` WHERE `name` = 'remind_config' OR `name` = 'remind_day';
DROP TABLE IF EXISTS `5kcrm_crm_customer_pool_record`;
CREATE TABLE `5kcrm_crm_customer_pool_record` (
`record_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`customer_id` int(10) UNSIGNED NOT NULL COMMENT '客户ID',
`user_id` int(10) UNSIGNED NOT NULL COMMENT '员工ID',
`pool_id` int(10) UNSIGNED NOT NULL COMMENT '公海ID',
`type` tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '类型1领取公海客户2将客户放入公海3分配客户',
`create_time` int(10) UNSIGNED NOT NULL COMMENT '创建时间',
PRIMARY KEY (`record_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '公海操作记录(领取公海客户、将客户放入公海)' ROW_FORMAT = Dynamic;
DROP TABLE IF EXISTS `5kcrm_crm_customer_pool_field_style`;
CREATE TABLE `5kcrm_crm_customer_pool_field_style` (
`id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`user_id` int(10) UNSIGNED NOT NULL COMMENT '用户ID',
`pool_id` int(10) UNSIGNED NOT NULL COMMENT '公海ID',
`content` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '字段内容',
`create_time` int(10) NOT NULL COMMENT '创建时间',
`update_time` int(10) NOT NULL COMMENT '更新时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '公海字段样式表' ROW_FORMAT = Dynamic;
CREATE TABLE `5kcrm_oa_examine_order` (
`order_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`examine_id` int(10) UNSIGNED NOT NULL,
`user_id` int(10) UNSIGNED NOT NULL,
`order` int(10) UNSIGNED NOT NULL DEFAULT 1,
PRIMARY KEY (`order_id`)
) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '办公审批流排序表' AUTO_INCREMENT = 5 ROW_FORMAT = DYNAMIC;
ALTER TABLE `5kcrm_admin_structure` ADD COLUMN `owner_user_id` int(5) unsigned DEFAULT 0 COMMENT '当前部门负责人';
INSERT INTO `5kcrm_admin_rule` ( `types`, `title`, `name`, `level`, `pid`, `status`) VALUES ( '3', '管理参与人权限', 'manageTaskOwnerUser', '4', '86', '0');
DROP TABLE IF EXISTS `5kcrm_crm_customer_pool`;
CREATE TABLE `5kcrm_crm_customer_pool` (
`pool_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`pool_name` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '名称',
`admin_user_ids` text CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '管理员IDS',
`user_ids` longtext CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '成员IDS',
`department_ids` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '部门IDS',
`status` tinyint(1) UNSIGNED NOT NULL DEFAULT 1 COMMENT '状态1启用0停用',
`before_owner_conf` tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '前负责人领取规则1限制0不限制',
`before_owner_day` tinyint(4) UNSIGNED NOT NULL DEFAULT 0 COMMENT '前负责人领取规则限制天数',
`receive_conf` tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '领取频率规则1限制0不限制',
`receive_count` tinyint(4) UNSIGNED NOT NULL DEFAULT 0 COMMENT '领取频率个数',
`remind_conf` tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '提醒规则1开启0不开启',
`remain_day` tinyint(4) UNSIGNED NOT NULL DEFAULT 0 COMMENT '提前几天提醒',
`recycle_conf` tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '自动回收规则1自动回收0不自动回收',
`create_user_id` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建人',
`create_time` int(10) UNSIGNED NOT NULL COMMENT '创建时间',
PRIMARY KEY (`pool_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '公海表' ROW_FORMAT = Dynamic;
DROP TABLE IF EXISTS `5kcrm_crm_customer_pool_field_setting`;
CREATE TABLE `5kcrm_crm_customer_pool_field_setting` (
`setting_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`pool_id` int(10) UNSIGNED NOT NULL COMMENT '公海ID',
`name` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '字段中文名',
`field_name` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '字段英文名',
`form_type` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '字段类型与5kcrm_admin_field表的form_type类型一致',
`is_hidden` tinyint(1) UNSIGNED NOT NULL COMMENT '是否隐藏1隐藏0不隐藏',
PRIMARY KEY (`setting_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '公海字段表' ROW_FORMAT = Dynamic;
DROP TABLE IF EXISTS `5kcrm_crm_customer_pool_relation`;
CREATE TABLE `5kcrm_crm_customer_pool_relation` (
`relation_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`pool_id` int(10) UNSIGNED NOT NULL COMMENT '公海ID',
`customer_id` int(10) UNSIGNED NOT NULL COMMENT '客户ID',
PRIMARY KEY (`relation_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 10 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '公海与客户关联表' ROW_FORMAT = Dynamic;
DROP TABLE IF EXISTS `5kcrm_crm_customer_pool_rule`;
CREATE TABLE `5kcrm_crm_customer_pool_rule` (
`rule_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`pool_id` int(10) UNSIGNED NOT NULL COMMENT '公海ID',
`type` tinyint(1) UNSIGNED NOT NULL COMMENT '收回规则类型1跟进记录2商机3成交状态',
`deal_handle` tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '选择不进入公海客户成交客户1已选0未选',
`business_handle` tinyint(1) UNSIGNED NOT NULL COMMENT '选择不进入公海客户有商机客户1已选0不选',
`level_conf` tinyint(1) UNSIGNED NOT NULL DEFAULT 1 COMMENT '客户级别设置1全部2根据客户级别设置',
`level` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '客户级别的设置数据',
`limit_day` tinyint(4) UNSIGNED NOT NULL DEFAULT 0 COMMENT '公海规则限制天数',
PRIMARY KEY (`rule_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 22 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '公海规则表' ROW_FORMAT = Dynamic;
DROP TABLE IF EXISTS `5kcrm_admin_upgrade_record`;
CREATE TABLE `5kcrm_admin_upgrade_record` (
`version` int(10) unsigned DEFAULT NULL COMMENT '版本号',
UNIQUE KEY `version` (`version`) USING BTREE
) ENGINE = InnoDB DEFAULT CHARSET = utf8 COMMENT = 'SQL更新记录用于防止重复执行更新。';
UPDATE `5kcrm_admin_group` SET `pid`='1', `title`='项目管理员', `rules`=',141,142,143,', `remark`='项目管理员', `status`='1', `type`='1', `types`='7', `system`='0'
WHERE `title`='项目管理员' AND `pid`='1' AND `remark`='项目管理员' AND `types`='7' AND `status`='1';