ALTER TABLE sale_merchant_apply
    ADD COLUMN `account_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '账户名称',
		ADD COLUMN `account_number` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '账户号码',
		ADD COLUMN `bank_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '开户银行',
		ADD COLUMN `brand_licensing` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '品牌授权书',
		ADD COLUMN `other_certificate` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '其他证书';

CREATE TABLE `sale_merchant_apply_log`(
                                          `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '审核记录id',
                                          `status` tinyint NOT NULL DEFAULT '0' COMMENT '申请状态  0:申请中 1:通过 2:未通过',
                                          `merchant_apply_id` bigint NOT NULL COMMENT '商户申请id',
                                          `check_system_user_id` bigint DEFAULT NULL COMMENT '审核系统用户id',
                                          `check_comment` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT '审核意见',
                                          `creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT '' COMMENT '创建者',
                                          `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
                                          `updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT '' COMMENT '更新者',
                                          `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
                                          `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
                                          PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC COMMENT='商户审核记录';

ALTER TABLE sale_merchant_apply
    MODIFY   `check_status` tinyint DEFAULT '0' COMMENT '审核状态：默认0表示未审核，1审核通过，2审核不通过';

ALTER TABLE sale_merchant_apply
    ADD COLUMN `legal_person` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '法人',
		ADD COLUMN `legal_person_number` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '法人电话',
		ADD COLUMN `identity_card_front` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '身份证正面',
		ADD COLUMN `identity_card_reverse_side` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '身份证反面';

ALTER TABLE sale_merchant
    ADD COLUMN `legal_person` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '法人',
		ADD COLUMN `legal_person_number` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '法人电话',
		ADD COLUMN `identity_card_front` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '身份证正面',
		ADD COLUMN `identity_card_reverse_side` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '身份证反面';

ALTER TABLE sale_merchant_apply
    ADD COLUMN `check_person_status` tinyint DEFAULT '1' COMMENT '审核人状态：默认1表示廖总，2徐总，3翁总, 0通过';


