CREATE TABLE `qimall_addons_valet_order` (
    `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'ID',
    `mall_id` INT(11) UNSIGNED NOT NULL DEFAULT '0' COMMENT '商城ID',
    `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 '更新事件',
    `user_id` INT(11) UNSIGNED NOT NULL DEFAULT '0' COMMENT '用户ID',
    `buy_user_id` INT(11) UNSIGNED NOT NULL DEFAULT '0' COMMENT '买家ID',
    `order_id` INT(11) UNSIGNED NOT NULL DEFAULT '0' COMMENT '订单ID',
    `order_no` CHAR(30) NOT NULL DEFAULT '0' COMMENT '订单编号' COLLATE 'utf8mb4_general_ci',
    `order_status` TINYINT(4) NOT NULL DEFAULT '0' COMMENT '订单状态',
    `order_goods_names` TEXT NULL DEFAULT NULL COMMENT '订单商品名称' COLLATE 'utf8mb4_general_ci',
    `order_amount` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0' COMMENT '订单金额',
    `mobile` CHAR(15) NOT NULL DEFAULT '' COMMENT '下单手机号' COLLATE 'utf8mb4_general_ci',
    `parent_mobile` CHAR(15) NOT NULL DEFAULT '' COMMENT '指定上级手机号码' COLLATE 'utf8mb4_general_ci',
    PRIMARY KEY (`id`) USING BTREE,
    INDEX `user_id` (`user_id`) USING BTREE,
    INDEX `buy_user_id` (`buy_user_id`) USING BTREE,
    INDEX `order_id` (`order_id`) USING BTREE,
    INDEX `order_no` (`order_no`) USING BTREE
)
COMMENT='代客下单'
COLLATE='utf8mb4_general_ci'
ENGINE=InnoDB;

CREATE TABLE `qimall_addons_valet_order_goods` (
    `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'ID',
    `mall_id` INT(11) UNSIGNED NOT NULL DEFAULT '0' COMMENT '商城ID',
    `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 '更新事件',
    `goods_id` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT '商品ID',
    PRIMARY KEY (`id`) USING BTREE,
    INDEX `goods_id` (`goods_id`) USING BTREE
)
COMMENT='支持的商品'
COLLATE='utf8mb4_general_ci'
ENGINE=InnoDB;

INSERT INTO `qimall_global_var_map` (`name`, `title`, `type`, `is_addons`, `created_at`, `updated_at`) VALUES ('ValetOrder', '代客下单', 'MarketingTypeMap', 1, 1654569888, 1654569888);