CREATE TABLE `qimall_addons_business_card` (
    `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
    `mall_id` INT(11) NOT NULL DEFAULT '0',
    `user_id` INT(11) NOT NULL DEFAULT '0',
    `mobile` CHAR(11) NOT NULL DEFAULT '0' COMMENT '电话' COLLATE 'utf8_general_ci',
    `nickname` VARCHAR(24) NOT NULL DEFAULT '' COMMENT '姓名' COLLATE 'utf8mb4_general_ci',
    `avatar_url` VARCHAR(255) NOT NULL DEFAULT '' COMMENT '头像' COLLATE 'utf8_general_ci',
    `department_id` MEDIUMINT(9) UNSIGNED NOT NULL DEFAULT '0' COMMENT '部门ID',
    `position_id` MEDIUMINT(9) UNSIGNED NOT NULL DEFAULT '0' COMMENT '职位ID',
    `phone` VARCHAR(24) NOT NULL DEFAULT '' COMMENT '座机' COLLATE 'utf8_general_ci',
    `email` VARCHAR(255) NOT NULL DEFAULT '' COMMENT '邮箱' COLLATE 'utf8_general_ci',
    `company` VARCHAR(48) NOT NULL DEFAULT '' COMMENT '公司' COLLATE 'utf8_general_ci',
    `address` VARCHAR(120) NOT NULL DEFAULT '' COMMENT '地址' COLLATE 'utf8mb4_general_ci',
    `sign` VARCHAR(120) NOT NULL DEFAULT '' COMMENT '个性签名' COLLATE 'utf8mb4_general_ci',
    `video` VARCHAR(255) NOT NULL DEFAULT '' COMMENT '视频' COLLATE 'utf8_general_ci',
    `tags` VARCHAR(255) NULL DEFAULT NULL COMMENT '标签，多个以逗号隔开' COLLATE 'utf8mb4_general_ci',
    `images` TEXT NULL DEFAULT NULL COMMENT '图文链接' COLLATE 'utf8_general_ci',
    `status` TINYINT(1) NOT NULL DEFAULT '1' COMMENT '状态[1启用 0禁用 -1删除]',
    `share_num` INT(11) NULL DEFAULT '0' COMMENT '分享次数',
    `created_at` INT(10) NOT NULL DEFAULT '0' COMMENT '创建时间',
    `updated_at` INT(10) NOT NULL DEFAULT '0' COMMENT '更新时间',
    `browse_num` INT(11) NOT NULL DEFAULT '0' COMMENT '浏览量(名片)',
    `like_num` INT(11) NOT NULL DEFAULT '0' COMMENT '点赞数',
    `video_cover_pic` VARCHAR(255) NOT NULL DEFAULT '' COMMENT '视频封面' COLLATE 'utf8_general_ci',
    PRIMARY KEY (`id`) USING BTREE,
    INDEX `mall_user_id` (`mall_id`, `user_id`) USING BTREE
)
COMMENT='智能名片表'
COLLATE='utf8_general_ci'
ENGINE=InnoDB;

CREATE TABLE `qimall_addons_business_card_buried_point` (
    `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
    `mall_id` INT(11) UNSIGNED NOT NULL DEFAULT '0',
    `user_id` INT(11) UNSIGNED NOT NULL DEFAULT '0',
    `item_id` INT(11) UNSIGNED NOT NULL DEFAULT '0' COMMENT '对象ID',
    `log_type` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' COMMENT '101首页，102商品详情',
    `status` TINYINT(1) NOT NULL DEFAULT '1' COMMENT '状态[1启用 0禁用 -1删除]',
    `created_at` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '创建时间',
    `updated_at` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '更新事件',
    `ext_data` JSON NULL DEFAULT NULL COMMENT '扩展信息',
    `object_id` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '对象ID',
    PRIMARY KEY (`id`) USING BTREE,
    INDEX `user_id` (`user_id`) USING BTREE,
    INDEX `item_id` (`item_id`) USING BTREE,
    INDEX `object_id` (`object_id`) USING BTREE
)
COMMENT='页面浏览埋点数据'
COLLATE='utf8mb4_general_ci'
ENGINE=InnoDB;

CREATE TABLE `qimall_addons_business_card_customer_log` (
    `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
    `mall_id` INT(11) NOT NULL DEFAULT '0',
    `user_id` INT(11) NOT NULL DEFAULT '0',
    `item_id` INT(11) NOT NULL DEFAULT '0' COMMENT '对象ID',
    `log_type` TINYINT(1) NOT NULL DEFAULT '1' COMMENT '1:浏览首页,2:查看图文,3:查看商品,4:授权号码,5:转发名片,6:查看名片,7:查看视频,8:保存手机,9:点赞,10:收藏,11:评论,12:查看动态,13:新增客户,14:新增线索,15:下单',
    `status` TINYINT(1) NOT NULL DEFAULT '1' COMMENT '状态[1启用 0禁用 -1删除]',
    `created_at` INT(10) NOT NULL DEFAULT '0' COMMENT '创建时间',
    `updated_at` INT(10) NOT NULL DEFAULT '0' COMMENT '更新事件',
    `material_log_id` INT(11) NULL DEFAULT NULL COMMENT '素材浏览ID',
    `material_id` INT(11) NULL DEFAULT NULL COMMENT '素材ID',
    `material_times` INT(11) NULL DEFAULT '1' COMMENT '次数',
    PRIMARY KEY (`id`) USING BTREE,
    INDEX `mall_user_log_item` (`mall_id`, `user_id`, `log_type`, `item_id`) USING BTREE
)
COMMENT='智能卡片用户轨迹表'
COLLATE='utf8_general_ci'
ENGINE=InnoDB;

CREATE TABLE `qimall_addons_business_card_follow_log` (
    `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
    `mall_id` INT(11) NOT NULL DEFAULT '0',
    `user_id` INT(11) NOT NULL DEFAULT '0',
    `operate_id` INT(11) NOT NULL DEFAULT '0' COMMENT '操作者ID',
    `log_type` TINYINT(1) NOT NULL DEFAULT '1' COMMENT '类型,1:修改意向，2:添加跟进记录',
    `remark` VARCHAR(255) NOT NULL DEFAULT '' COMMENT '记录说明' COLLATE 'utf8mb4_general_ci',
    `status` TINYINT(1) NOT NULL DEFAULT '1' COMMENT '状态[1启用 0禁用 -1删除]',
    `created_at` INT(10) NOT NULL DEFAULT '0' COMMENT '创建时间',
    `updated_at` INT(10) NOT NULL DEFAULT '0' COMMENT '更新事件',
    PRIMARY KEY (`id`) USING BTREE,
    INDEX `mall_user_id` (`mall_id`, `user_id`) USING BTREE
)
COMMENT='智能卡片用户跟进表'
COLLATE='utf8_general_ci'
ENGINE=InnoDB;

CREATE TABLE `qimall_addons_business_card_goods_statistics` (
    `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
    `mall_id` INT(11) NOT NULL DEFAULT '0',
    `user_id` INT(11) NOT NULL DEFAULT '0' COMMENT '用户ID',
    `parent_id` INT(11) NOT NULL DEFAULT '0' COMMENT '分享者ID',
    `goods_id` INT(11) NULL DEFAULT '0' COMMENT '商品ID',
    `total_visitors` INT(11) NOT NULL DEFAULT '0' COMMENT '访客数',
    `total_views` INT(11) UNSIGNED NOT NULL DEFAULT '0' COMMENT '浏览量',
    `browse_time` INT(11) NULL DEFAULT '0' COMMENT '浏览时长',
    `status` TINYINT(1) NOT NULL DEFAULT '1' COMMENT '状态[1启用 0禁用 -1删除]',
    `created_at` INT(10) NOT NULL DEFAULT '0' COMMENT '创建时间',
    `updated_at` INT(10) NOT NULL DEFAULT '0' COMMENT '更新时间',
    PRIMARY KEY (`id`) USING BTREE,
    INDEX `mall_id` (`mall_id`) USING BTREE,
    INDEX `good_id` (`goods_id`) USING BTREE
)
    COMMENT='商品统计表'
COLLATE='utf8_unicode_ci'
ENGINE=InnoDB;

CREATE TABLE `qimall_addons_business_card_material` (
    `id` INT(11) NOT NULL AUTO_INCREMENT COMMENT '名片素材',
    `mall_id` INT(11) NULL DEFAULT '0' COMMENT '商城ID',
    `user_id` INT(11) NULL DEFAULT '0' COMMENT '用户ID',
    `title` VARCHAR(128) NULL DEFAULT '' COMMENT '标题' COLLATE 'utf8mb4_general_ci',
    `intro` VARCHAR(255) NULL DEFAULT '' COMMENT '简介' COLLATE 'utf8mb4_general_ci',
    `ext_type` VARCHAR(16) NULL DEFAULT 'pic_text' COMMENT '素材格式：pdf=PDF,video=视频，pic_text=图文,link=链接' COLLATE 'utf8mb4_general_ci',
    `cate_id` INT(11) NULL DEFAULT '0' COMMENT '分类ID',
    `is_show` TINYINT(4) NULL DEFAULT '1' COMMENT '是否展示',
    `share_title` VARCHAR(128) NULL DEFAULT '' COMMENT '分享标题' COLLATE 'utf8mb4_general_ci',
    `share_desc` VARCHAR(255) NULL DEFAULT '' COMMENT '分享描述' COLLATE 'utf8mb4_general_ci',
    `cover_img` VARCHAR(255) NULL DEFAULT '' COMMENT '封面图片' COLLATE 'utf8mb4_general_ci',
    `material_link` VARCHAR(255) NULL DEFAULT '' COMMENT '素材链接，如link链接、video链接和pdf文件链接' COLLATE 'utf8mb4_general_ci',
    `material_cont` TEXT NULL DEFAULT NULL COMMENT '素材内容，例如图文' COLLATE 'utf8mb4_general_ci',
    `status` TINYINT(4) NULL DEFAULT '1' COMMENT '状态[-1:删除;0:禁用;1启用]',
    `created_at` INT(11) NULL DEFAULT '0' COMMENT '创建时间',
    `updated_at` INT(11) NULL DEFAULT '0' COMMENT '更新时间',
    PRIMARY KEY (`id`) USING BTREE,
    INDEX `addons_card_material_mall_id` (`mall_id`) USING BTREE,
    INDEX `addons_card_material_cate_id` (`cate_id`) USING BTREE
)
COLLATE='utf8mb4_general_ci'
ENGINE=InnoDB;

CREATE TABLE `qimall_addons_business_card_material_browse` (
    `id` INT(11) NOT NULL AUTO_INCREMENT COMMENT '名片素材客户浏览统计',
    `mall_id` INT(11) NULL DEFAULT '0' COMMENT '商城ID',
    `user_id` INT(11) NULL DEFAULT '0' COMMENT '用户ID',
    `view_material` INT(11) NULL DEFAULT '0' COMMENT '查看素材数量',
    `view_times` INT(11) NULL DEFAULT '0' COMMENT '观看总次数',
    `view_seconds` BIGINT(20) NULL DEFAULT '0' COMMENT '观看总时长（秒）',
    `recent_time` INT(11) NULL DEFAULT '0' COMMENT '最近观看时间戳',
    `status` TINYINT(4) NULL DEFAULT '1' COMMENT '状态[-1:删除;0:禁用;1启用]',
    `created_at` INT(11) NULL DEFAULT '0' COMMENT '创建时间',
    `updated_at` INT(11) NULL DEFAULT '0' COMMENT '更新时间',
    PRIMARY KEY (`id`) USING BTREE,
    INDEX `addons_card_material_browse_mall_id` (`mall_id`) USING BTREE
)
COLLATE='utf8mb4_general_ci'
ENGINE=InnoDB;

CREATE TABLE `qimall_addons_business_card_material_browse_log` (
    `id` INT(11) NOT NULL AUTO_INCREMENT COMMENT '名片素材客户浏览记录',
    `mall_id` INT(11) NULL DEFAULT '0' COMMENT '商城ID',
    `user_id` INT(11) NULL DEFAULT '0' COMMENT '用户ID',
    `material_id` INT(11) NULL DEFAULT '0' COMMENT '素材ID',
    `view_seconds` BIGINT(20) NULL DEFAULT '0' COMMENT '观看时长（秒）',
    `status` TINYINT(4) NULL DEFAULT '1' COMMENT '状态[-1:删除;0:禁用;1启用]',
    `created_at` INT(11) NULL DEFAULT '0' COMMENT '创建时间',
    `updated_at` INT(11) NULL DEFAULT '0' COMMENT '更新时间',
    `view_times` INT(11) NULL DEFAULT '0' COMMENT '累计观看次数',
    `share_user_id` INT(11) NULL DEFAULT '0' COMMENT '分享的销售员',
    `share_user_type` INT(11) NULL DEFAULT '1' COMMENT '1分享人，2上级',
    `unikey` CHAR(16) NULL DEFAULT '' COMMENT '标识' COLLATE 'utf8mb4_general_ci',
    PRIMARY KEY (`id`) USING BTREE,
    INDEX `addons_card_material_browse_log_mall_id` (`mall_id`) USING BTREE,
    INDEX `addons_card_material_browse_log_user_id` (`user_id`) USING BTREE,
    INDEX `addons_card_material_browse_log_material_id` (`material_id`) USING BTREE
)
COLLATE='utf8mb4_general_ci'
ENGINE=InnoDB;

CREATE TABLE `qimall_addons_business_card_material_cate` (
    `id` INT(11) NOT NULL AUTO_INCREMENT COMMENT '名片素材分类',
    `mall_id` INT(11) NULL DEFAULT '0' COMMENT '商城ID',
    `name` VARCHAR(128) NULL DEFAULT '' COMMENT '分类名称' COLLATE 'utf8mb4_general_ci',
    `order_sort` INT(11) NULL DEFAULT '0' COMMENT '排序',
    `status` TINYINT(4) NULL DEFAULT '1' COMMENT '状态[-1:删除;0:禁用;1启用]',
    `created_at` INT(11) NULL DEFAULT '0' COMMENT '创建时间',
    `updated_at` INT(11) NULL DEFAULT '0' COMMENT '更新时间',
    PRIMARY KEY (`id`) USING BTREE,
    INDEX `addons_card_material_cate_mall_id` (`mall_id`) USING BTREE
)
COLLATE='utf8mb4_general_ci'
ENGINE=InnoDB;

CREATE TABLE `qimall_addons_business_card_material_share` (
    `id` INT(11) NOT NULL AUTO_INCREMENT COMMENT '用户分享素材统计',
    `mall_id` INT(11) NULL DEFAULT '0' COMMENT '商城ID',
    `user_id` INT(11) NULL DEFAULT '0' COMMENT '用户ID',
    `material_id` INT(11) NULL DEFAULT '0' COMMENT '素材ID',
    `share_times` INT(11) NULL DEFAULT '0' COMMENT '分享次数',
    `recent_time` INT(11) NULL DEFAULT '0' COMMENT '最近分享时间',
    `status` TINYINT(4) NULL DEFAULT '1' COMMENT '状态[-1:删除;0:禁用;1启用]',
    `created_at` INT(11) NULL DEFAULT '0' COMMENT '创建时间',
    `updated_at` INT(11) NULL DEFAULT '0' COMMENT '更新时间',
    PRIMARY KEY (`id`) USING BTREE
)
COLLATE='utf8mb4_general_ci'
ENGINE=InnoDB;

CREATE TABLE `qimall_addons_business_card_material_statistics` (
    `id` INT(11) NOT NULL AUTO_INCREMENT COMMENT '名片素材数据统计',
    `mall_id` INT(11) NULL DEFAULT '0' COMMENT '商城ID',
    `material_id` INT(11) NULL DEFAULT '0' COMMENT '素材ID',
    `view_seconds` BIGINT(20) NULL DEFAULT '0' COMMENT '观看总时长（秒）',
    `view_numbers` BIGINT(15) NULL DEFAULT '0' COMMENT '观看人数',
    `view_times` BIGINT(15) NULL DEFAULT '0' COMMENT '观看次数',
    `share_times` BIGINT(15) NULL DEFAULT '0' COMMENT '分享次数',
    `status` TINYINT(4) NULL DEFAULT '1' COMMENT '状态[-1:删除;0:禁用;1启用]',
    `created_at` INT(11) NULL DEFAULT '0' COMMENT '创建时间',
    `updated_at` INT(11) NULL DEFAULT '0' COMMENT '更新时间',
    PRIMARY KEY (`id`) USING BTREE,
    INDEX `addons_card_material_statistics_mall_id` (`mall_id`) USING BTREE,
    INDEX `addons_card_material_statistics_material_id` (`material_id`) USING BTREE
)
COLLATE='utf8mb4_general_ci'
ENGINE=InnoDB;

CREATE TABLE `qimall_addons_business_card_order` (
    `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
    `mall_id` INT(11) UNSIGNED NOT NULL DEFAULT '0',
    `user_id` INT(11) UNSIGNED NOT NULL DEFAULT '0',
    `item_id` INT(11) UNSIGNED NOT NULL DEFAULT '0' COMMENT '对象ID',
    `log_type` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0' COMMENT '201',
    `status` TINYINT(1) NOT NULL DEFAULT '1' COMMENT '状态[1启用 0禁用 -1删除]',
    `created_at` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '创建时间',
    `updated_at` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '更新事件',
    `order_id` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '订单ID',
    `order_no` CHAR(26) NOT NULL DEFAULT '' COMMENT '订单编号' COLLATE 'utf8mb4_general_ci',
    `order_status` TINYINT(4) NOT NULL DEFAULT '0' COMMENT '订单状态',
    `pay_amount` DECIMAL(10,2) UNSIGNED NOT NULL DEFAULT '0.00' COMMENT '支付金额',
    `is_pay` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0' COMMENT '是否已支付',
    PRIMARY KEY (`id`) USING BTREE,
    INDEX `user_id` (`user_id`) USING BTREE,
    INDEX `item_id` (`item_id`) USING BTREE,
    INDEX `order_id` (`order_id`) USING BTREE
)
COMMENT='订单记录'
COLLATE='utf8mb4_general_ci'
ENGINE=InnoDB;

CREATE TABLE `qimall_addons_business_card_position` (
    `id` MEDIUMINT(9) UNSIGNED NOT NULL AUTO_INCREMENT,
    `mall_id` INT(11) NOT NULL DEFAULT '0',
    `parent_id` MEDIUMINT(9) NOT NULL DEFAULT '0' COMMENT '所属部门ID',
    `name` VARCHAR(48) NOT NULL DEFAULT '' COMMENT '名称' COLLATE 'utf8mb4_general_ci',
    `sort` TINYINT(4) NOT NULL DEFAULT '0' COMMENT '排序，大的靠前',
    `status` TINYINT(1) NOT NULL DEFAULT '1' COMMENT '状态[1启用 0禁用 -1删除]',
    `created_at` INT(10) NOT NULL DEFAULT '0' COMMENT '创建时间',
    `updated_at` INT(10) NOT NULL DEFAULT '0' COMMENT '更新时间',
    PRIMARY KEY (`id`) USING BTREE,
    INDEX `mall_id` (`mall_id`) USING BTREE,
    INDEX `parent_id` (`parent_id`) USING BTREE
)
COMMENT='只能名片部门职位表'
COLLATE='utf8_general_ci'
ENGINE=InnoDB;

CREATE TABLE `qimall_addons_business_card_statistics` (
    `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
    `mall_id` INT(11) NOT NULL DEFAULT '0',
    `user_id` INT(11) NOT NULL DEFAULT '0',
    `card_num` INT(11) NOT NULL DEFAULT '0' COMMENT '名片数量',
    `clue_num` INT(11) NOT NULL DEFAULT '0' COMMENT '线索数量',
    `browse_num` INT(11) NOT NULL DEFAULT '0' COMMENT '浏览量(名片)',
    `share_num` INT(11) NULL DEFAULT '0' COMMENT '分享次数',
    `like_num` INT(11) NOT NULL DEFAULT '0' COMMENT '点赞数',
    `order_num` INT(11) NOT NULL DEFAULT '0' COMMENT '订单数量',
    `order_money` DECIMAL(10,2) NOT NULL DEFAULT '0.00' COMMENT '支付金额',
    `status` TINYINT(1) NOT NULL DEFAULT '1' COMMENT '状态[1启用 0禁用 -1删除]',
    `created_at` INT(10) NOT NULL DEFAULT '0' COMMENT '创建时间',
    `updated_at` INT(10) NOT NULL DEFAULT '0' COMMENT '修改时间',
    PRIMARY KEY (`id`) USING BTREE,
    INDEX `user_id` (`user_id`) USING BTREE,
    INDEX `mall_create_time` (`mall_id`, `created_at`) USING BTREE
)
    COMMENT='名片每日数据统计表'
COLLATE='utf8_general_ci'
ENGINE=InnoDB;

CREATE TABLE `qimall_addons_business_card_task` (
    `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
    `mall_id` INT(11) NOT NULL DEFAULT '0',
    `last_id` INT(11) NOT NULL DEFAULT '0' COMMENT '上次执行id',
    `total_num` INT(11) UNSIGNED NOT NULL DEFAULT '0' COMMENT '上次执行条数',
    `status` TINYINT(1) NOT NULL DEFAULT '1' COMMENT '状态[1启用 0禁用 -1删除]',
    `created_at` INT(10) NOT NULL DEFAULT '0' COMMENT '创建时间',
    `updated_at` INT(10) NOT NULL DEFAULT '0' COMMENT '更新事件',
    PRIMARY KEY (`id`) USING BTREE
)
COMMENT='商品统计定时任务执行记录表'
COLLATE='utf8_unicode_ci'
ENGINE=InnoDB;

CREATE TABLE `qimall_addons_business_card_user` (
    `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
    `mall_id` INT(11) NOT NULL DEFAULT '0',
    `user_id` INT(11) NOT NULL DEFAULT '0' COMMENT '成为客户的USERID',
    `parent_id` INT(11) NOT NULL DEFAULT '0' COMMENT '分享者ID',
    `tags` TEXT NULL DEFAULT NULL COMMENT '标签逗号隔开' COLLATE 'utf8_general_ci',
    `customer_type` TINYINT(1) NOT NULL DEFAULT '1' COMMENT '客户类型',
    `department_id` MEDIUMINT(9) NOT NULL DEFAULT '0' COMMENT '部门ID',
    `position_id` MEDIUMINT(9) NOT NULL DEFAULT '0' COMMENT '职位ID',
    `role_type` TINYINT(1) NOT NULL DEFAULT '0' COMMENT '角色类型，1：Boos，2：主管，3：员工',
    `is_clue` TINYINT(1) NOT NULL DEFAULT '1' COMMENT '是否成为线索',
    `customer_nickname` VARCHAR(48) NOT NULL DEFAULT '' COMMENT '客户昵称' COLLATE 'utf8mb4_general_ci',
    `customer_sex` TINYINT(1) NOT NULL DEFAULT '1' COMMENT '客户性别, 1:男，2:女',
    `customer_mobile` CHAR(11) NOT NULL DEFAULT '' COMMENT '客户手机号' COLLATE 'utf8_general_ci',
    `customer_email` VARCHAR(120) NOT NULL DEFAULT '' COMMENT '客户邮箱' COLLATE 'utf8_general_ci',
    `customer_address` VARCHAR(120) NOT NULL DEFAULT '' COMMENT '客户地址' COLLATE 'utf8mb4_general_ci',
    `customer_birthday` CHAR(8) NOT NULL DEFAULT '' COMMENT '客户生日' COLLATE 'utf8_general_ci',
    `customer_remark` VARCHAR(255) NOT NULL DEFAULT '' COMMENT '客户备注' COLLATE 'utf8mb4_general_ci',
    `share_num` INT(11) NULL DEFAULT '0' COMMENT '分享次数',
    `status` TINYINT(1) NOT NULL DEFAULT '1' COMMENT '状态[1启用 0禁用 -1删除]',
    `created_at` INT(10) NOT NULL DEFAULT '0' COMMENT '创建时间',
    `updated_at` INT(10) NOT NULL DEFAULT '0' COMMENT '更新事件',
    PRIMARY KEY (`id`) USING BTREE,
    INDEX `mall_user_id` (`mall_id`, `user_id`) USING BTREE,
    INDEX `mall_parent_id` (`mall_id`, `parent_id`) USING BTREE
)
COMMENT='智能卡片用户表'
COLLATE='utf8_general_ci'
ENGINE=InnoDB;

CREATE TABLE `qimall_addons_business_card_user_score` (
    `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
    `mall_id` INT(11) NOT NULL DEFAULT '0',
    `user_id` INT(11) NOT NULL DEFAULT '0' COMMENT '成为客户的USERID',
    `status` TINYINT(1) NOT NULL DEFAULT '1' COMMENT '状态[1启用 0禁用 -1删除]',
    `created_at` INT(10) NOT NULL DEFAULT '0' COMMENT '创建时间',
    `updated_at` INT(10) NOT NULL DEFAULT '0' COMMENT '更新事件',
    `score` INT(10) NOT NULL DEFAULT '0' COMMENT '分数',
    PRIMARY KEY (`id`) USING BTREE,
    INDEX `user_id` (`user_id`) USING BTREE
)
COMMENT='用户行为评分'
COLLATE='utf8mb4_general_ci'
ENGINE=InnoDB;

INSERT INTO `qimall_crontab_task` (`name`, `command`, `type`, `rule`, `is_warning`, `status`, `created_at`, `updated_at`) VALUES ('新智能名片统计商品访问量', 'business-card/goods-statistics/update-goods-statistics', 1, '0 0 0 * * *', 0, 1, 1687777506, 1687777506);
