-- ----------------------------
-- Table structure for qimall_addons_happiness_agent
-- ----------------------------
DROP TABLE IF EXISTS `qimall_addons_happiness_agent`;
CREATE TABLE `qimall_addons_happiness_agent`  (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) NOT NULL DEFAULT 0 COMMENT '用户ID',
`mall_id` int(11) NOT NULL DEFAULT 0 COMMENT '商城ID',
`level` int(11) NOT NULL COMMENT '权重',
`status` int(11) NOT NULL DEFAULT 1 COMMENT '状态',
`role` tinyint(3) NOT NULL DEFAULT 0 COMMENT '代理等级：1 省，2市，3区',
`district_id` int(11) NOT NULL DEFAULT 0 COMMENT '区',
`province_id` int(11) NOT NULL DEFAULT 0 COMMENT '省',
`city_id` int(11) NOT NULL DEFAULT 0 COMMENT '市',
`parent_id` int(11) NOT NULL DEFAULT 0 COMMENT '推广用户',
`region_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '中文名',
`created_at` int(11) NOT NULL DEFAULT 0,
`updated_at` int(11) NOT NULL DEFAULT 0,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for qimall_addons_happiness_agent_admin
-- ----------------------------
DROP TABLE IF EXISTS `qimall_addons_happiness_agent_admin`;
CREATE TABLE `qimall_addons_happiness_agent_admin`  (
`id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
`username` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '登录账号',
`account` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '姓名',
`password` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '密码',
`avatar` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '头像',
`mobile` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '手机号',
`mall_id` int(11) NOT NULL DEFAULT 0 COMMENT '商城id',
`user_id` int(11) NOT NULL DEFAULT 0 COMMENT '会员id',
`auth_key` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '',
`access_token` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '',
`admin_type` tinyint(1) NOT NULL DEFAULT 0 COMMENT '管理员类型1超级管理员2管理员3操作员',
`created_at` int(11) NOT NULL DEFAULT 0,
`updated_at` int(11) NOT NULL DEFAULT 0,
`status` tinyint(1) NULL DEFAULT 1 COMMENT '状态[-1:删除;0:禁用;1启用]',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '幸福小店后台管理员表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for qimall_addons_happiness_agent_menu
-- ----------------------------
DROP TABLE IF EXISTS `qimall_addons_happiness_agent_menu`;
CREATE TABLE `qimall_addons_happiness_agent_menu`  (
`id` int(11) NOT NULL AUTO_INCREMENT,
`title` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '标题',
`app_id` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '0' COMMENT '应用id',
`pid` int(50) UNSIGNED NULL DEFAULT 0 COMMENT '上级id',
`addons_name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '插件标识',
`is_addon` tinyint(2) NULL DEFAULT 0 COMMENT '是否插件[0=否，1=是]',
`url` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '路由',
`icon` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '样式',
`level` tinyint(1) UNSIGNED NULL DEFAULT 1 COMMENT '级别',
`dev` tinyint(4) UNSIGNED NULL DEFAULT 0 COMMENT '开发者[0:都可见;开发模式可见]',
`sort` int(5) NULL DEFAULT 999 COMMENT '排序',
`params` json NULL COMMENT '参数',
`tree` varchar(300) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '树',
`status` tinyint(4) NULL DEFAULT 1 COMMENT '状态[-1:删除;0:禁用;1启用]',
`created_at` int(10) UNSIGNED NULL DEFAULT 0 COMMENT '添加时间',
`updated_at` int(10) UNSIGNED NULL DEFAULT 0 COMMENT '修改时间',
PRIMARY KEY (`id`) USING BTREE,
INDEX `url`(`url`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '幸福小店后台菜单' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for qimall_addons_happiness_boss
-- ----------------------------
DROP TABLE IF EXISTS `qimall_addons_happiness_boss`;
CREATE TABLE `qimall_addons_happiness_boss`  (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) NOT NULL DEFAULT 0 COMMENT '用户ID',
`mall_id` int(11) NOT NULL DEFAULT 0 COMMENT '商城ID',
`level` int(11) NOT NULL COMMENT '权重',
`status` int(11) NOT NULL DEFAULT 1 COMMENT '状态',
`parent_id` int(11) NOT NULL DEFAULT 0 COMMENT '推广用户',
`created_at` int(11) NOT NULL DEFAULT 0,
`updated_at` int(11) NOT NULL DEFAULT 0,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for qimall_addons_happiness_business
-- ----------------------------
DROP TABLE IF EXISTS `qimall_addons_happiness_business`;
CREATE TABLE `qimall_addons_happiness_business`  (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) NOT NULL DEFAULT 0 COMMENT '用户ID',
`mall_id` int(11) NOT NULL DEFAULT 0 COMMENT '商城ID',
`level` int(11) NOT NULL COMMENT '权重',
`status` int(11) NOT NULL DEFAULT 1 COMMENT '状态',
`created_at` int(11) NOT NULL DEFAULT 0,
`updated_at` int(11) NOT NULL DEFAULT 0,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for qimall_addons_happiness_cashier_order
-- ----------------------------
DROP TABLE IF EXISTS `qimall_addons_happiness_cashier_order`;
CREATE TABLE `qimall_addons_happiness_cashier_order`  (
`id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
`mall_id` int(11) NOT NULL DEFAULT 0,
`store_id` int(11) NOT NULL DEFAULT 0 COMMENT '门店id',
`user_id` int(11) NOT NULL DEFAULT 0 COMMENT '会员id',
`order_no` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '订单编号',
`pay_status` tinyint(1) NOT NULL DEFAULT 0 COMMENT '支付状态：0：否；1：是',
`pay_time` int(11) NOT NULL DEFAULT 0 COMMENT '付款时间',
`money` decimal(12, 2) NOT NULL DEFAULT 0.00 COMMENT '应付金额',
`pay_money` decimal(12, 2) NOT NULL DEFAULT 0.00 COMMENT '实付金额',
`payment_type` tinyint(1) NOT NULL DEFAULT 0 COMMENT '支付类型',
`amount_received` decimal(12, 2) NOT NULL DEFAULT 0.00 COMMENT '实收金额',
`service_money` decimal(12, 2) UNSIGNED NOT NULL DEFAULT 0.00 COMMENT '服务费',
`remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '备注',
`extra` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '额外信息：例如优惠信息，团队分红，经销分红',
`status` tinyint(1) NOT NULL DEFAULT 1 COMMENT '状态[0禁用 1启用 -1删除]',
`created_at` int(11) NOT NULL DEFAULT 0 COMMENT '创建时间',
`updated_at` int(11) NOT NULL DEFAULT 0 COMMENT '修改时间',
PRIMARY KEY (`id`) USING BTREE,
INDEX `idx_order_no`(`order_no`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '门店收银订单' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for qimall_addons_happiness_cashier_order_detail
-- ----------------------------
DROP TABLE IF EXISTS `qimall_addons_happiness_cashier_order_detail`;
CREATE TABLE `qimall_addons_happiness_cashier_order_detail`  (
`id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '订单项ID',
`cashier_order_id` int(11) NOT NULL DEFAULT 0 COMMENT '收银台订单ID',
`user_id` int(11) NOT NULL DEFAULT 0 COMMENT '用户id',
`mall_id` int(11) NOT NULL DEFAULT 0 COMMENT '商城ID',
`goods_id` int(11) NOT NULL DEFAULT 0 COMMENT '商品ID',
`goods_name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '商品名称',
`goods_attr_id` int(11) NOT NULL DEFAULT 0 COMMENT '规格ID',
`goods_attr_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '规格名称',
`sign_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '规格ID标识',
`attr_groups_format` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '格式化规格组',
`price` decimal(19, 2) NOT NULL DEFAULT 0.00 COMMENT '商品价格',
`cost_price` decimal(10, 2) NOT NULL DEFAULT 0.00 COMMENT '商品成本价',
`original_goods_price` decimal(10, 2) NOT NULL DEFAULT 0.00 COMMENT '商品原本总价',
`goods_price` decimal(10, 2) NOT NULL DEFAULT 0.00 COMMENT '商品优惠后总价',
`num` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '购买数量',
`pic_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '商品图片',
`order_status` int(11) NOT NULL DEFAULT 0 COMMENT '订单状态【0待付款 1待发货 2 已发货 3已收货 4已完成 -1申请售后 -2售后中 -3售后完成 -4 已关闭 -5撤销售后】',
`is_virtual` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否包含 虚拟商品   0 不包含  1  包含',
`status` tinyint(4) NOT NULL DEFAULT 1 COMMENT '状态[-1:删除;0:禁用;1启用]',
`extra_info` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '额外信息',
`created_at` int(10) NOT NULL DEFAULT 0,
`updated_at` int(10) NOT NULL DEFAULT 0,
`store_id` int(11) NOT NULL DEFAULT 0 COMMENT '门店id',
PRIMARY KEY (`id`) USING BTREE,
INDEX `order_detail_goods_buyer_id`(`user_id`) USING BTREE,
INDEX `order_detail_goods_goods_id`(`goods_id`) USING BTREE,
INDEX `order_detail_goods_order_id`(`cashier_order_id`) USING BTREE,
INDEX `order_detail_goods_attr_id`(`goods_attr_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '收银台订单商品详情表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for qimall_addons_happiness_commission_log
-- ----------------------------
DROP TABLE IF EXISTS `qimall_addons_happiness_commission_log`;
CREATE TABLE `qimall_addons_happiness_commission_log`  (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) NOT NULL DEFAULT 0 COMMENT '用户ID',
`money` decimal(12, 2) NOT NULL DEFAULT 0.00 COMMENT '获得佣金',
`status` tinyint(12) NOT NULL DEFAULT 1,
`commission_status` tinyint(3) NOT NULL DEFAULT 0 COMMENT '状态：0 未结算 1 已结算 2 已到账 3 已取消',
`commission_type` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '佣金类型: 0 分享收益 1 锁定收益 2 推广收益 3 代理收益',
`store_id` int(11) NOT NULL DEFAULT 0 COMMENT '小店ID',
`mall_id` int(11) NOT NULL DEFAULT 0,
`agent_id` int(11) NOT NULL DEFAULT 0 COMMENT '来源代理user_id',
`order_no` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '',
`order_id` int(11) NOT NULL DEFAULT 0,
`order_money` decimal(11, 2) NOT NULL DEFAULT 0.00 COMMENT '订单金额',
`send_time` int(11) NOT NULL COMMENT '延迟发放时间',
`remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '',
`created_at` int(11) NOT NULL DEFAULT 0,
`updated_at` int(11) NOT NULL DEFAULT 0,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for qimall_addons_happiness_expenses_log
-- ----------------------------
DROP TABLE IF EXISTS `qimall_addons_happiness_expenses_log`;
CREATE TABLE `qimall_addons_happiness_expenses_log`  (
`id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
`mall_id` int(11) NOT NULL DEFAULT 0 COMMENT '商城id',
`store_id` int(11) NOT NULL DEFAULT 0 COMMENT '小店id',
`user_id` int(11) NOT NULL DEFAULT 0 COMMENT '会员id',
`order_id` int(11) NOT NULL DEFAULT 0 COMMENT '订单id',
`order_no` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '订单编号',
`order_money` decimal(10, 2) NOT NULL DEFAULT 0.00 COMMENT '订单金额',
`store_money` decimal(10, 2) NOT NULL DEFAULT 0.00 COMMENT '小店收益',
`share_money` decimal(10, 2) NOT NULL DEFAULT 0.00 COMMENT '分享奖励',
`promotion_money` decimal(10, 2) NOT NULL DEFAULT 0.00 COMMENT '推广奖励',
`agent_money` decimal(10, 2) NOT NULL DEFAULT 0.00 COMMENT '代理奖励',
`fans_money` decimal(10, 2) NOT NULL DEFAULT 0.00 COMMENT '锁定奖励',
`pension_money` decimal(10, 2) NOT NULL DEFAULT 0.00 COMMENT '养老金',
`pv_money` decimal(10, 2) NOT NULL DEFAULT 0.00 COMMENT 'PV值',
`status` tinyint(1) NOT NULL DEFAULT 1 COMMENT '状态[0禁用 1启用 -1删除]',
`created_at` int(11) NULL DEFAULT 0 COMMENT '添加时间戳',
`updated_at` int(11) NULL DEFAULT 0 COMMENT '更新时间戳',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '支出统计表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for qimall_addons_happiness_goods
-- ----------------------------
DROP TABLE IF EXISTS `qimall_addons_happiness_goods`;
CREATE TABLE `qimall_addons_happiness_goods`  (
`id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'id',
`mall_id` int(11) NOT NULL COMMENT '商城id',
`goods_id` int(11) NOT NULL COMMENT '商品id',
`label_id` int(11) NOT NULL COMMENT '商品标签id',
`store_scale` decimal(12, 2) NOT NULL DEFAULT 0.00,
`min_num` int(11) NOT NULL DEFAULT 0 COMMENT '最低提货数量',
`warn_day` int(11) NOT NULL DEFAULT 0 COMMENT '临期提醒',
`sales_num` int(11) NOT NULL DEFAULT 0 COMMENT '商品销量',
`is_on_sale` tinyint(1) NOT NULL DEFAULT 0 COMMENT '上架状态【1是 0否】',
`freight_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '[]' COMMENT '配送方式',
`created_at` int(11) NULL DEFAULT NULL COMMENT '添加时间',
`updated_at` int(11) NULL DEFAULT NULL COMMENT '修改时间',
`status` tinyint(1) NOT NULL DEFAULT 1 COMMENT '状态[1正常 -1删除]',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '幸福小店后台商品表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for qimall_addons_happiness_goods_ranking
-- ----------------------------
DROP TABLE IF EXISTS `qimall_addons_happiness_goods_ranking`;
CREATE TABLE `qimall_addons_happiness_goods_ranking`  (
`id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
`mall_id` int(11) NOT NULL DEFAULT 0,
`store_id` int(11) NOT NULL DEFAULT 0 COMMENT '门店id',
`goods_id` int(11) NOT NULL DEFAULT 0 COMMENT '商品id',
`sales_money` decimal(14, 2) NOT NULL COMMENT '销售额',
`status` tinyint(1) NOT NULL DEFAULT 1 COMMENT '状态[0禁用 1启用 -1删除]',
`created_at` int(11) NOT NULL DEFAULT 0 COMMENT '创建时间',
`updated_at` int(11) NOT NULL DEFAULT 0 COMMENT '修改时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '门店商品排行榜' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for qimall_addons_happiness_history_store
-- ----------------------------
DROP TABLE IF EXISTS `qimall_addons_happiness_history_store`;
CREATE TABLE `qimall_addons_happiness_history_store`  (
`id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'id',
`mall_id` int(11) NOT NULL COMMENT '商城id',
`user_id` int(11) NOT NULL COMMENT '用户id',
`store_id` int(11) NOT NULL COMMENT '门店id',
`status` tinyint(1) NOT NULL DEFAULT 1 COMMENT '状态（1：正常，-1：删除）',
`created_at` int(11) NULL DEFAULT NULL COMMENT '创建时间',
`updated_at` int(11) NULL DEFAULT NULL COMMENT '修改时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '用户选择历史自提门店' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for qimall_addons_happiness_lock_user
-- ----------------------------
DROP TABLE IF EXISTS `qimall_addons_happiness_lock_user`;
CREATE TABLE `qimall_addons_happiness_lock_user`  (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) NOT NULL DEFAULT 0,
`store_id` int(11) NOT NULL DEFAULT 0,
`mall_id` int(11) NOT NULL DEFAULT 0,
`order_no` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '下单单号',
`status` int(11) NOT NULL DEFAULT 1,
`created_at` int(11) NOT NULL DEFAULT 0,
`updated_at` int(11) NOT NULL DEFAULT 0,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '锁定用户表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for qimall_addons_happiness_move_goods
-- ----------------------------
DROP TABLE IF EXISTS `qimall_addons_happiness_move_goods`;
CREATE TABLE `qimall_addons_happiness_move_goods`  (
`id` int(11) NOT NULL AUTO_INCREMENT,
`goods_id` int(11) NOT NULL DEFAULT 0 COMMENT '商品ID',
`move_id` int(11) NOT NULL DEFAULT 0 COMMENT '调货单ID',
`attr_id` int(11) NOT NULL DEFAULT 0 COMMENT '规格ID',
`num` int(11) NOT NULL DEFAULT 0 COMMENT '调货数量',
`mall_id` int(11) NOT NULL DEFAULT 0 COMMENT '商城ID',
`total_price` decimal(10, 2) NOT NULL DEFAULT 0.00 COMMENT '总价格',
`created_at` int(11) NOT NULL DEFAULT 0,
`updated_at` int(11) NOT NULL DEFAULT 0,
`status` int(11) NOT NULL DEFAULT 1,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for qimall_addons_happiness_move_item
-- ----------------------------
DROP TABLE IF EXISTS `qimall_addons_happiness_move_item`;
CREATE TABLE `qimall_addons_happiness_move_item`  (
`id` int(11) NOT NULL AUTO_INCREMENT,
`goods_id` int(11) NOT NULL DEFAULT 0 COMMENT '商品ID',
`store_id` int(11) NOT NULL DEFAULT 0 COMMENT '小店ID',
`order_status` tinyint(3) NOT NULL DEFAULT 0 COMMENT '状态:0待调货,1 已调货 2已拒绝',
`status` int(11) NOT NULL DEFAULT 1,
`total_price` decimal(10, 2) NOT NULL DEFAULT 0.00 COMMENT '总价',
`total_num` int(11) NOT NULL DEFAULT 0 COMMENT '总数量',
`created_at` int(11) NOT NULL DEFAULT 0,
`updated_at` int(11) NOT NULL DEFAULT 0,
`agent_user` int(11) NOT NULL DEFAULT 0 COMMENT '审核代理用户ID',
`label_id` int(11) NOT NULL DEFAULT 0 COMMENT '标签ID',
`remark` varchar(2000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '备注',
`give_store_id` int(11) NOT NULL DEFAULT 0 COMMENT '被调货小店ID',
`mall_id` int(11) NOT NULL DEFAULT 0,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for qimall_addons_happiness_order
-- ----------------------------
DROP TABLE IF EXISTS `qimall_addons_happiness_order`;
CREATE TABLE `qimall_addons_happiness_order`  (
`id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'id',
`mall_id` int(11) NOT NULL COMMENT '商城id',
`user_id` int(11) NOT NULL COMMENT '用户id',
`store_id` int(11) NOT NULL COMMENT '门店id',
`order_id` int(11) NOT NULL COMMENT '订单id',
`shipping_type` tinyint(1) NULL DEFAULT NULL COMMENT '快递方式（1：快递配送，2：门店自提，3：送货上门）',
`order_no` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '订单编号',
`created_at` int(11) NULL DEFAULT NULL COMMENT '创建时间',
`updated_at` int(11) NULL DEFAULT NULL COMMENT '修改时间',
`parent_id` int(11) NULL DEFAULT 0 COMMENT '推荐用户',
`price` decimal(14, 2) NOT NULL COMMENT '支付金额',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '门店订单表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for qimall_addons_happiness_order_refund
-- ----------------------------
DROP TABLE IF EXISTS `qimall_addons_happiness_order_refund`;
CREATE TABLE `qimall_addons_happiness_order_refund`  (
`id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'id',
`mall_id` int(11) NOT NULL COMMENT '商城id',
`store_id` int(11) NOT NULL COMMENT '门店id',
`refund_id` int(11) NOT NULL COMMENT '售后id',
`order_detail_id` int(11) NOT NULL COMMENT '订单详情id',
`order_id` int(11) NOT NULL COMMENT '订单id',
`created_at` int(11) NULL DEFAULT NULL COMMENT '创建时间',
`updated_at` int(11) NULL DEFAULT NULL COMMENT '修改时间',
`user_id` int(11) NOT NULL COMMENT '用户id',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '门店售后单表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for qimall_addons_happiness_pension
-- ----------------------------
DROP TABLE IF EXISTS `qimall_addons_happiness_pension`;
CREATE TABLE `qimall_addons_happiness_pension`  (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'id',
`user_id` int(11) NOT NULL DEFAULT 0 COMMENT '用户ID',
`money` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '0' COMMENT '养老金金额',
`uid` int(11) NOT NULL DEFAULT 0 COMMENT '养老金用户ID',
`order_no` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '订单号',
`order_id` int(11) NOT NULL DEFAULT 0 COMMENT '订单ID',
`is_settle` tinyint(3) NOT NULL DEFAULT 0 COMMENT '结算状态,0 未结算,  1已结算',
`order_status` tinyint(3) NOT NULL DEFAULT 0 COMMENT '入账状态,-1 已退款 0 待发起，1已发起, 2待打款金额 3已打款金额',
`result_sn` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '入账编号',
`result_code` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '入账结果',
`result_time` int(11) NOT NULL DEFAULT 0 COMMENT '入账时间',
`mall_id` int(11) NOT NULL DEFAULT 0 COMMENT '商城ID',
`status` int(11) NOT NULL DEFAULT 1 COMMENT '状态: 0：禁用,1：正常',
`settle_time` int(11) NOT NULL DEFAULT 0 COMMENT '订单完成时间',
`created_at` int(11) NOT NULL DEFAULT 0,
`updated_at` int(11) NOT NULL DEFAULT 0,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '养老金订单' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for qimall_addons_happiness_store
-- ----------------------------
DROP TABLE IF EXISTS `qimall_addons_happiness_store`;
CREATE TABLE `qimall_addons_happiness_store`  (
`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',
`business_id` int(11) NOT NULL DEFAULT 0 COMMENT '业务会员ID',
`shop_owner` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '店长姓名',
`no` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '编号',
`shop_mobile` varchar(11) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '店长手机号',
`store_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '门店名称',
`store_desc` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '门店简介',
`logo_img` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '门店logo',
`license_img` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '营业执照',
`province_id` int(11) NULL DEFAULT 0 COMMENT '省',
`city_id` int(11) NULL DEFAULT 0 COMMENT '市',
`district_id` int(11) NULL DEFAULT 0 COMMENT '区',
`address` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '详细地址',
`street_id` int(11) NULL DEFAULT NULL COMMENT '街道',
`expire_time` bigint(20) NOT NULL DEFAULT 0 COMMENT '失效时间，0代表无限期',
`total_money` decimal(12, 2) NOT NULL DEFAULT 0.00 COMMENT '累计收入',
`balance` decimal(12, 2) NOT NULL DEFAULT 0.00 COMMENT '当前余额',
`frozen_balance` decimal(12, 2) NOT NULL DEFAULT 0.00 COMMENT '冻结资产',
`total_expenses` decimal(12, 2) NOT NULL DEFAULT 0.00 COMMENT '累计支出',
`user_nums` int(11) NULL DEFAULT 0 COMMENT '会员总数',
`longitude` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '经度',
`latitude` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '维度',
`business_time_start` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '00:00' COMMENT '营业时间开始',
`business_time_end` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '23:59' COMMENT '营业时间结束',
`freight_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '配送设置',
`intra_city_distribution` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '{\"is_alone\":\"1\",\"distribution_scope\":\"\",\"delivery_fee\":\"0\",\"initial_delivery_amount\":\"0\",\"distance\":\"0\",\"distance_charge\":\"0\",\"every_distance\":\"0\",\"every_distance_charge\":\"0\"}' COMMENT '同城配送',
`total_order_money` decimal(12, 2) NOT NULL DEFAULT 0.00 COMMENT '订单总金额',
`total_num` int(11) NOT NULL DEFAULT 0 COMMENT '总数',
`total_settled_amount` decimal(12, 2) NOT NULL DEFAULT 0.00 COMMENT '已结算总金额',
`unsettled_amount` decimal(12, 2) NOT NULL DEFAULT 0.00 COMMENT '未结算金额',
`sales_volume` int(11) NOT NULL DEFAULT 0 COMMENT '销量',
`refund_money` decimal(12, 2) NOT NULL DEFAULT 0.00 COMMENT '退款金额',
`refund_num` int(11) NOT NULL DEFAULT 0 COMMENT '退款总订单数',
`fine_money` decimal(12, 2) NOT NULL DEFAULT 0.00 COMMENT '罚款金额',
`praise` decimal(3, 1) NOT NULL DEFAULT 5.0 COMMENT '评分',
`status` tinyint(1) NOT NULL DEFAULT 1 COMMENT '状态[0禁用 1启用 -1删除]',
`shop_status` tinyint(4) NOT NULL DEFAULT 1 COMMENT '门店营业状态，1：正在营业；0：休息中',
`created_at` int(11) NOT NULL DEFAULT 0 COMMENT '创建时间',
`updated_at` int(11) NOT NULL DEFAULT 0 COMMENT '修改时间',
`is_freeze` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否冻结 0 否 1 是',
`share_amount` decimal(12, 2) NOT NULL DEFAULT 0.00 COMMENT '已分账金额',
`merchant_distribution` tinyint(1) NOT NULL DEFAULT 1 COMMENT '同城配送',
`self_mention` tinyint(1) NOT NULL DEFAULT 1 COMMENT '上门自提',
`is_alone` tinyint(1) NOT NULL DEFAULT 0 COMMENT '配置（0：系统配置，1:独立配置）',
`distribution_scope` decimal(14, 2) NULL DEFAULT 10000.00 COMMENT '配送范围',
`check_status` tinyint(1) NOT NULL DEFAULT 0 COMMENT '审核状态：0：待审核；1：已通过；2：未通过',
`check_remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '审核备注',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '门店' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for qimall_addons_happiness_store_admin
-- ----------------------------
DROP TABLE IF EXISTS `qimall_addons_happiness_store_admin`;
CREATE TABLE `qimall_addons_happiness_store_admin`  (
`id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
`username` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '登录账号',
`account` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '姓名',
`password` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '密码',
`avatar` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '头像',
`mobile` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '手机号',
`store_id` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '门店id',
`mall_id` int(11) NOT NULL DEFAULT 0 COMMENT '商城id',
`user_id` int(11) NOT NULL DEFAULT 0 COMMENT '会员id',
`auth_key` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '',
`access_token` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '',
`admin_type` tinyint(1) NOT NULL DEFAULT 0 COMMENT '管理员类型1超级管理员2管理员3操作员',
`created_at` int(11) NOT NULL DEFAULT 0,
`updated_at` int(11) NOT NULL DEFAULT 0,
`status` tinyint(1) NULL DEFAULT 1 COMMENT '状态[-1:删除;0:禁用;1启用]',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '幸福小店后台管理员表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for qimall_addons_happiness_store_bank
-- ----------------------------
DROP TABLE IF EXISTS `qimall_addons_happiness_store_bank`;
CREATE TABLE `qimall_addons_happiness_store_bank`  (
`id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
`mall_id` int(11) NOT NULL DEFAULT 0 COMMENT '商城id',
`store_id` int(11) NOT NULL DEFAULT 0 COMMENT '门店id',
`username` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '开户名',
`bank` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '开户银行',
`card_no` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '银行卡号',
`created_at` int(11) NOT NULL DEFAULT 0,
`updated_at` int(11) NOT NULL DEFAULT 0,
`status` tinyint(1) NULL DEFAULT 1 COMMENT '状态[-1:删除;0:禁用;1启用]',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '门店提现银行卡' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for qimall_addons_happiness_store_census
-- ----------------------------
DROP TABLE IF EXISTS `qimall_addons_happiness_store_census`;
CREATE TABLE `qimall_addons_happiness_store_census`  (
`id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
`mall_id` int(11) NOT NULL DEFAULT 0,
`store_id` int(11) NOT NULL DEFAULT 0 COMMENT '门店id',
`add_user_nums` int(11) NOT NULL DEFAULT 0 COMMENT '新增会员',
`order_nums` int(11) NOT NULL DEFAULT 0 COMMENT '订单数',
`sales_money` decimal(12, 2) NOT NULL DEFAULT 0.00 COMMENT '门店销售额',
`date_time` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '日期时间',
`status` tinyint(1) NOT NULL DEFAULT 1 COMMENT '状态[0禁用 1启用 -1删除]',
`created_at` int(11) NOT NULL DEFAULT 0 COMMENT '创建时间',
`updated_at` int(11) NOT NULL DEFAULT 0 COMMENT '修改时间',
`settlement_commission` decimal(14, 2) NOT NULL DEFAULT 0.00 COMMENT '结算佣金',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '门店每日统计' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for qimall_addons_happiness_store_clerk
-- ----------------------------
DROP TABLE IF EXISTS `qimall_addons_happiness_store_clerk`;
CREATE TABLE `qimall_addons_happiness_store_clerk`  (
`id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
`mall_id` int(11) NOT NULL DEFAULT 0,
`store_id` int(11) NOT NULL DEFAULT 0 COMMENT '幸福小店id',
`user_id` int(11) NOT NULL DEFAULT 0 COMMENT '会员id',
`nums` int(11) NOT NULL DEFAULT 0 COMMENT '累计核销订单数',
`total_money` decimal(12, 2) NOT NULL DEFAULT 0.00 COMMENT '累计核销金额',
`remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '备注',
`status` tinyint(1) NOT NULL DEFAULT 1 COMMENT '状态[0禁用 1启用 -1删除]',
`created_at` int(11) NOT NULL DEFAULT 0 COMMENT '创建时间',
`updated_at` int(11) NOT NULL DEFAULT 0 COMMENT '修改时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '幸福小店核销员' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for qimall_addons_happiness_store_clerk_log
-- ----------------------------
DROP TABLE IF EXISTS `qimall_addons_happiness_store_clerk_log`;
CREATE TABLE `qimall_addons_happiness_store_clerk_log`  (
`id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
`mall_id` int(11) NOT NULL DEFAULT 0,
`store_id` int(11) NOT NULL DEFAULT 0 COMMENT '门店id',
`user_id` int(11) NOT NULL DEFAULT 0 COMMENT '会员id',
`clerk_id` int(11) NOT NULL DEFAULT 0 COMMENT '核销员id',
`mobile` varchar(11) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '0' COMMENT '电话',
`order_no` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '订单编号',
`status` tinyint(1) NOT NULL DEFAULT 1 COMMENT '状态[0禁用 1启用 -1删除]',
`created_at` int(11) NOT NULL DEFAULT 0 COMMENT '创建时间',
`updated_at` int(11) NOT NULL DEFAULT 0 COMMENT '修改时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '门店核销明细' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for qimall_addons_happiness_store_commission
-- ----------------------------
DROP TABLE IF EXISTS `qimall_addons_happiness_store_commission`;
CREATE TABLE `qimall_addons_happiness_store_commission`  (
`id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
`mall_id` int(11) NOT NULL DEFAULT 0 COMMENT '商城id',
`store_id` int(11) NOT NULL DEFAULT 0 COMMENT '门店id',
`user_id` int(11) NOT NULL DEFAULT 0 COMMENT '会员id',
`order_no` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '订单编号',
`order_money` decimal(12, 2) NOT NULL DEFAULT 0.00 COMMENT '订单金额',
`pay_money` decimal(12, 2) NOT NULL DEFAULT 0.00 COMMENT '支付金额',
`discount_money` decimal(12, 2) NOT NULL DEFAULT 0.00 COMMENT '优惠金额',
`service_charge` decimal(12, 2) NOT NULL DEFAULT 0.00 COMMENT '服务费',
`amount_received` decimal(12, 2) NOT NULL DEFAULT 0.00 COMMENT '实际货款收益',
`is_settlement` tinyint(1) NOT NULL DEFAULT 0 COMMENT '结算状态 0：待结算；1：已结算',
`store_scale` decimal(12, 2) NOT NULL DEFAULT 0.00 COMMENT '货款收益比例',
`all_commission` decimal(12, 2) NOT NULL DEFAULT 0.00 COMMENT '总佣金,订单金额*货款收益比例',
`share_commission` decimal(12, 2) NOT NULL DEFAULT 0.00 COMMENT '用户分享收益',
`store_share_commission` decimal(12, 2) NOT NULL DEFAULT 0.00 COMMENT '店主分享收益',
`created_at` int(11) NOT NULL DEFAULT 0,
`updated_at` int(11) NOT NULL DEFAULT 0,
`type` tinyint(3) NOT NULL DEFAULT 1 COMMENT '订单类型:1为正常订单,2为收款码订单',
`status` tinyint(1) NULL DEFAULT 1 COMMENT '状态[-1:删除;0:禁用;1启用]',
`settle_type` tinyint(1) NOT NULL DEFAULT 0 COMMENT '1:商品售价,2:订单实际支付,3:商品成本+运费,4:订单实际支付+积分抵扣',
`score_money` decimal(14, 2) NOT NULL COMMENT '积分抵扣金额',
`platform_ratio` int(5) NOT NULL DEFAULT 0 COMMENT '收取的服务费比例',
PRIMARY KEY (`id`) USING BTREE,
INDEX `idx_order_no`(`order_no`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '门店提成明细' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for qimall_addons_happiness_store_goods
-- ----------------------------
DROP TABLE IF EXISTS `qimall_addons_happiness_store_goods`;
CREATE TABLE `qimall_addons_happiness_store_goods`  (
`id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'id',
`mall_id` int(11) NOT NULL COMMENT '商城id',
`store_id` int(11) NOT NULL COMMENT '幸福小店门店id',
`goods_id` int(11) NOT NULL COMMENT '商品id',
`sales_num` int(11) NOT NULL DEFAULT 0 COMMENT '商品销量',
`is_on_sale` tinyint(1) NOT NULL DEFAULT 1 COMMENT '上架状态【1是 0否】',
`freight_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '[]' COMMENT '配送方式',
`created_at` int(11) NULL DEFAULT NULL COMMENT '创建时间',
`updated_at` int(11) NULL DEFAULT NULL COMMENT '修改时间',
`status` tinyint(1) NOT NULL DEFAULT 1 COMMENT '状态[1正常 -1删除]',
`stock` int(11) NOT NULL DEFAULT 0 COMMENT '库存',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '幸福小店门店商品' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for qimall_addons_happiness_store_goods_attr
-- ----------------------------
DROP TABLE IF EXISTS `qimall_addons_happiness_store_goods_attr`;
CREATE TABLE `qimall_addons_happiness_store_goods_attr`  (
`id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'id',
`mall_id` int(11) NOT NULL COMMENT '商城id',
`store_id` int(11) NOT NULL COMMENT '幸福小店门店id',
`goods_id` int(11) NOT NULL COMMENT '商品id',
`attr_id` int(11) NOT NULL COMMENT '规格id',
`stock` int(11) NOT NULL DEFAULT 0 COMMENT '库存',
`status` tinyint(1) NOT NULL DEFAULT 1 COMMENT '状态（1：正常，-1：删除）',
`created_at` int(11) NULL DEFAULT NULL COMMENT '创建时间',
`updated_at` int(11) NULL DEFAULT NULL COMMENT '修改时间',
`yun_goods_id` int(11) NOT NULL DEFAULT 0 COMMENT '幸福小店商品id',
`is_on_sale` tinyint(1) NOT NULL DEFAULT 1 COMMENT '上架状态【1是 0否】',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '幸福小店门店商品规格表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for qimall_addons_happiness_store_menu
-- ----------------------------
DROP TABLE IF EXISTS `qimall_addons_happiness_store_menu`;
CREATE TABLE `qimall_addons_happiness_store_menu`  (
`id` int(11) NOT NULL AUTO_INCREMENT,
`title` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '标题',
`app_id` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '0' COMMENT '应用id',
`pid` int(50) UNSIGNED NULL DEFAULT 0 COMMENT '上级id',
`addons_name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '插件标识',
`is_addon` tinyint(2) NULL DEFAULT 0 COMMENT '是否插件[0=否，1=是]',
`url` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '路由',
`icon` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '样式',
`level` tinyint(1) UNSIGNED NULL DEFAULT 1 COMMENT '级别',
`dev` tinyint(4) UNSIGNED NULL DEFAULT 0 COMMENT '开发者[0:都可见;开发模式可见]',
`sort` int(5) NULL DEFAULT 999 COMMENT '排序',
`params` json NULL COMMENT '参数',
`tree` varchar(300) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '树',
`status` tinyint(4) NULL DEFAULT 1 COMMENT '状态[-1:删除;0:禁用;1启用]',
`created_at` int(10) UNSIGNED NULL DEFAULT 0 COMMENT '添加时间',
`updated_at` int(10) UNSIGNED NULL DEFAULT 0 COMMENT '修改时间',
PRIMARY KEY (`id`) USING BTREE,
INDEX `url`(`url`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '幸福小店后台菜单' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for qimall_addons_happiness_store_mini_code
-- ----------------------------
DROP TABLE IF EXISTS `qimall_addons_happiness_store_mini_code`;
CREATE TABLE `qimall_addons_happiness_store_mini_code`  (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'ID',
`mall_id` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '商城ID',
`store_id` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '门店id',
`type` tinyint(1) NOT NULL DEFAULT 0 COMMENT '1:推广码；2：收银台二维码',
`code` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '分享码',
`content` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '二维码参数',
`applet_code` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' 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
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '门店小程序码生成表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for qimall_addons_happiness_store_statistics
-- ----------------------------
DROP TABLE IF EXISTS `qimall_addons_happiness_store_statistics`;
CREATE TABLE `qimall_addons_happiness_store_statistics`  (
`id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
`mall_id` int(11) NOT NULL DEFAULT 0 COMMENT '商城id',
`store_id` int(11) NOT NULL DEFAULT 0 COMMENT '门店id',
`date_time` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '月份',
`income_money` decimal(12, 2) NOT NULL DEFAULT 0.00 COMMENT '收入',
`created_at` int(11) NOT NULL DEFAULT 0,
`updated_at` int(11) NOT NULL DEFAULT 0,
`status` tinyint(1) NULL DEFAULT 1 COMMENT '状态[-1:删除;0:禁用;1启用]',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '门店月份统计' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for qimall_addons_happiness_store_user
-- ----------------------------
DROP TABLE IF EXISTS `qimall_addons_happiness_store_user`;
CREATE TABLE `qimall_addons_happiness_store_user`  (
`id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
`mall_id` int(11) NOT NULL DEFAULT 0,
`store_id` int(11) NOT NULL DEFAULT 0 COMMENT '门店id',
`user_id` int(11) NOT NULL DEFAULT 0 COMMENT '会员id',
`last_time` int(11) NOT NULL DEFAULT 0 COMMENT '最近下单时间',
`order_nums` int(11) NOT NULL DEFAULT 0 COMMENT '店内下单数',
`pay_nums` int(11) NOT NULL DEFAULT 0 COMMENT '店内消费订单数',
`pay_money` decimal(12, 2) NOT NULL DEFAULT 0.00 COMMENT '店内消费金额',
`refund_nums` int(11) NOT NULL DEFAULT 0 COMMENT '累计退款订单数',
`refund_money` decimal(12, 2) NOT NULL DEFAULT 0.00 COMMENT '累计退款金额',
`status` tinyint(1) NOT NULL DEFAULT 1 COMMENT '状态[0禁用 1启用 -1删除]',
`created_at` int(11) NOT NULL DEFAULT 0 COMMENT '创建时间',
`updated_at` int(11) NOT NULL DEFAULT 0 COMMENT '修改时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '门店会员' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for qimall_addons_happiness_third_user
-- ----------------------------
DROP TABLE IF EXISTS `qimall_addons_happiness_third_user`;
CREATE TABLE `qimall_addons_happiness_third_user`  (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) NOT NULL DEFAULT 0 COMMENT '用户ID',
`uid` int(11) NOT NULL DEFAULT 0 COMMENT '积分平台用户ID',
`mall_id` int(11) NOT NULL DEFAULT 0 COMMENT '商城ID',
`type` tinyint(3) NOT NULL DEFAULT 0 COMMENT '第三方平台类型：1 养老金平台 2 积分平台',
`id_no` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '身份证号',
`id_img` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '身份证正面图片',
`id_back_img` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '身份证反面图片',
`is_real` tinyint(3) NOT NULL DEFAULT 0 COMMENT '是否需要实名,0 为未实名 1为已实名',
`status` int(11) NOT NULL DEFAULT 1 COMMENT '状态：0 禁用 1正常',
`created_at` int(11) NOT NULL DEFAULT 0,
`updated_at` int(11) NOT NULL DEFAULT 0,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '第三方平台用户关联表' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for qimall_addons_happiness_voucher_express
-- ----------------------------
DROP TABLE IF EXISTS `qimall_addons_happiness_voucher_express`;
CREATE TABLE `qimall_addons_happiness_voucher_express`  (
`id` int(11) NOT NULL AUTO_INCREMENT,
`order_id` int(11) NOT NULL DEFAULT 0 COMMENT '提货订单ID',
`order_no` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '提货订单号',
`express_no` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '物流单号',
`express_company` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '物流公司',
`status` int(11) NOT NULL DEFAULT 1,
`get_status` tinyint(3) NOT NULL DEFAULT 0 COMMENT '提货状态:0 未确认 1已确认',
`mall_id` int(11) NOT NULL DEFAULT 0,
`created_at` int(11) NOT NULL DEFAULT 0,
`updated_at` int(11) NOT NULL DEFAULT 0,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for qimall_addons_happiness_voucher_express_goods
-- ----------------------------
DROP TABLE IF EXISTS `qimall_addons_happiness_voucher_express_goods`;
CREATE TABLE `qimall_addons_happiness_voucher_express_goods`  (
`id` int(11) NOT NULL AUTO_INCREMENT,
`express_id` int(11) NOT NULL DEFAULT 0 COMMENT '物流ID',
`order_no` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '提货订单号',
`order_id` int(11) NOT NULL DEFAULT 0 COMMENT '提货订单ID',
`goods_id` int(11) NOT NULL DEFAULT 0 COMMENT '商品ID',
`attr_id` int(11) NOT NULL DEFAULT 0 COMMENT '规格ID',
`num` int(11) NOT NULL DEFAULT 0 COMMENT '提货数量',
`mall_id` int(11) NOT NULL DEFAULT 0 COMMENT '商城ID',
`status` int(11) NOT NULL DEFAULT 1,
`created_at` int(11) NOT NULL DEFAULT 0,
`updated_at` int(11) NOT NULL DEFAULT 0,
`create_date` int(11) NOT NULL DEFAULT 0 COMMENT '生产日期',
`expire_date` int(11) NOT NULL DEFAULT 0 COMMENT '过期日期',
`save_day` int(11) NOT NULL DEFAULT 0 COMMENT '保质天数',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for qimall_addons_happiness_voucher_goods
-- ----------------------------
DROP TABLE IF EXISTS `qimall_addons_happiness_voucher_goods`;
CREATE TABLE `qimall_addons_happiness_voucher_goods`  (
`id` int(11) NOT NULL AUTO_INCREMENT,
`order_id` int(11) NOT NULL DEFAULT 0 COMMENT '提货订单ID',
`goods_id` int(11) NOT NULL DEFAULT 0 COMMENT '商品ID',
`attr_id` int(11) NOT NULL DEFAULT 0 COMMENT '规格ID',
`num` int(11) NOT NULL DEFAULT 0 COMMENT '提货数量',
`leave_num` int(11) NOT NULL DEFAULT 0 COMMENT '剩余提货数量',
`mall_id` int(11) NOT NULL DEFAULT 0 COMMENT '商城ID',
`voucher` decimal(11, 2) NOT NULL DEFAULT 0.00 COMMENT '消费提货券',
`label_id` int(11) NOT NULL DEFAULT 0 COMMENT '商品标签',
`status` int(11) NOT NULL DEFAULT 1,
`created_at` int(11) NOT NULL DEFAULT 0,
`updated_at` int(11) NOT NULL DEFAULT 0,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for qimall_addons_happiness_voucher_log
-- ----------------------------
DROP TABLE IF EXISTS `qimall_addons_happiness_voucher_log`;
CREATE TABLE `qimall_addons_happiness_voucher_log`  (
`id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
`mall_id` int(11) UNSIGNED NOT NULL DEFAULT 0,
`level` int(11) NOT NULL DEFAULT 0,
`store_id` int(11) UNSIGNED NOT NULL DEFAULT 0,
`wallet_type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '',
`change_type` char(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '操作类型：add-增加，sub-减少',
`change_num` decimal(12, 2) UNSIGNED NOT NULL COMMENT '操作数量',
`after_num` decimal(12, 2) NOT NULL DEFAULT 0.00 COMMENT '变动后数量',
`desc` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '变动说明',
`source_table` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '来源表',
`source_table_id` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '操作来源业务id',
`from_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '来源类型',
`status` tinyint(4) NOT NULL DEFAULT 1 COMMENT '状态，-1：失效，1：正常，2：冻结',
`order_no` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '订单号',
`created_at` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '添加时间戳',
`updated_at` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '更新时间戳',
`addon_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT 'WeightReward' COMMENT '来源插件名称',
PRIMARY KEY (`id`) USING BTREE,
INDEX `idx_mall_user`(`mall_id`, `store_id`) USING BTREE,
INDEX `idx_source`(`source_table`, `source_table_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '权重值钱包' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for qimall_addons_happiness_voucher_order
-- ----------------------------
DROP TABLE IF EXISTS `qimall_addons_happiness_voucher_order`;
CREATE TABLE `qimall_addons_happiness_voucher_order`  (
`id` int(11) NOT NULL AUTO_INCREMENT,
`order_no` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '0' COMMENT '提货批次',
`total_num` int(11) NOT NULL DEFAULT 0 COMMENT '总提货数量',
`leave_num` int(11) NOT NULL DEFAULT 0 COMMENT '剩余提货数量',
`user_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '提货人',
`mobile` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '提货人手机号',
`address` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '提货地址',
`status` tinyint(3) NOT NULL DEFAULT 1,
`price` decimal(10, 2) NOT NULL DEFAULT 0.00 COMMENT '提货总价',
`mall_id` int(11) NOT NULL DEFAULT 0,
`store_id` int(11) NOT NULL DEFAULT 0 COMMENT '小店ID',
`order_status` tinyint(3) NOT NULL DEFAULT 0 COMMENT '0未审核,1已审核 2 部分发货 3已全部发货 4已收货 5 已拒绝',
`remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '备注',
`created_at` int(11) NULL DEFAULT 0,
`updated_at` int(11) NULL DEFAULT 0,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for qimall_addons_happiness_voucher_wallet
-- ----------------------------
DROP TABLE IF EXISTS `qimall_addons_happiness_voucher_wallet`;
CREATE TABLE `qimall_addons_happiness_voucher_wallet`  (
`id` int(11) NOT NULL AUTO_INCREMENT,
`level` int(11) NOT NULL DEFAULT 0 COMMENT '商品标签权重',
`balance` decimal(11, 2) NOT NULL DEFAULT 0.00 COMMENT '提货券数量',
`freeze_balance` decimal(11, 2) NOT NULL DEFAULT 0.00 COMMENT '冻结数量',
`store_id` int(11) NOT NULL DEFAULT 0 COMMENT '小店ID',
`mall_id` int(11) NOT NULL DEFAULT 0 COMMENT '商城ID',
`status` tinyint(3) NOT NULL COMMENT '状态：0：禁用,1：正常',
`created_at` int(11) NOT NULL DEFAULT 0,
`updated_at` int(11) NOT NULL DEFAULT 0,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '提货券' ROW_FORMAT = Dynamic;

-- ----------------------------
-- Table structure for qimall_addons_happiness_withdraw_log
-- ----------------------------
DROP TABLE IF EXISTS `qimall_addons_happiness_withdraw_log`;
CREATE TABLE `qimall_addons_happiness_withdraw_log`  (
`id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
`mall_id` int(11) NOT NULL DEFAULT 0 COMMENT '商城id',
`store_id` int(11) NOT NULL DEFAULT 0 COMMENT '门店id',
`user_id` int(11) NOT NULL DEFAULT 0 COMMENT '会员id',
`order_no` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '提现订单号',
`num` decimal(10, 2) NOT NULL DEFAULT 0.00 COMMENT '提现金额',
`actual_num` decimal(10, 2) NOT NULL DEFAULT 0.00 COMMENT '实际到账金额',
`poundage_num` decimal(10, 2) NOT NULL DEFAULT 0.00 COMMENT '手续费扣除金额',
`poundage_ratio` float NOT NULL DEFAULT 0 COMMENT '手续费比例',
`type` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '提现方式 bank--银行转账 balance--打款到余额',
`extra` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '额外信息',
`withdraw_status` int(11) NOT NULL DEFAULT 0 COMMENT '提现状态 0--待打款 --已打款 2--驳回 ',
`status` int(11) NOT NULL DEFAULT 0 COMMENT '状态[0禁用 1启用 -1删除]',
`remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '备注',
`created_at` int(11) NULL DEFAULT 0 COMMENT '添加时间戳',
`updated_at` int(11) NULL DEFAULT 0 COMMENT '更新时间戳',
`content` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '用户额外输入信息',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '门店提现记录表' ROW_FORMAT = Dynamic;
INSERT INTO `qimall_addons_happiness_agent_menu` (`id`, `title`, `app_id`, `pid`, `addons_name`, `is_addon`, `url`, `icon`, `level`, `dev`, `sort`, `params`, `tree`, `status`, `created_at`, `updated_at`) VALUES (1, '小店管理', '0', 0, '', 0, 'happiness/agent/store/index', 'el-icon-s-platform', 1, 0, 999, NULL, '', 1, 0, 0);
INSERT INTO `qimall_addons_happiness_agent_menu` (`id`, `title`, `app_id`, `pid`, `addons_name`, `is_addon`, `url`, `icon`, `level`, `dev`, `sort`, `params`, `tree`, `status`, `created_at`, `updated_at`) VALUES (2, '订单管理', '0', 0, '', 0, 'happiness/agent/order/index', 'el-icon-s-order', 1, 0, 999, NULL, '', 1, 0, 0);
INSERT INTO `qimall_addons_happiness_agent_menu` (`id`, `title`, `app_id`, `pid`, `addons_name`, `is_addon`, `url`, `icon`, `level`, `dev`, `sort`, `params`, `tree`, `status`, `created_at`, `updated_at`) VALUES (3, '收款码订单', '0', 0, '', 0, 'happiness/agent/store-casher/index', 'el-icon-s-order', 1, 0, 999, NULL, '', 1, 0, 0);
INSERT INTO `qimall_addons_happiness_agent_menu` (`id`, `title`, `app_id`, `pid`, `addons_name`, `is_addon`, `url`, `icon`, `level`, `dev`, `sort`, `params`, `tree`, `status`, `created_at`, `updated_at`) VALUES (4, '售后订单', '0', 0, '', 0, 'happiness/agent/order/refund', 'el-icon-s-order', 1, 0, 999, NULL, '', 1, 0, 0);
INSERT INTO `qimall_addons_happiness_agent_menu` (`id`, `title`, `app_id`, `pid`, `addons_name`, `is_addon`, `url`, `icon`, `level`, `dev`, `sort`, `params`, `tree`, `status`, `created_at`, `updated_at`) VALUES (5, '流水管理', '0', 0, '', 0, 'happiness/agent/store-assets/index', 'el-icon-coin', 1, 0, 999, NULL, '', 1, 0, 0);
INSERT INTO `qimall_addons_happiness_agent_menu` (`id`, `title`, `app_id`, `pid`, `addons_name`, `is_addon`, `url`, `icon`, `level`, `dev`, `sort`, `params`, `tree`, `status`, `created_at`, `updated_at`) VALUES (6, '流水统计', '0', 0, '', 0, 'happiness/agent/store-statistics/index', 'el-icon-coin', 1, 0, 999, NULL, '', 1, 0, 0);
INSERT INTO `qimall_addons_happiness_agent_menu` (`id`, `title`, `app_id`, `pid`, `addons_name`, `is_addon`, `url`, `icon`, `level`, `dev`, `sort`, `params`, `tree`, `status`, `created_at`, `updated_at`) VALUES (7, '调货申请', '0', 0, '', 0, 'happiness/agent/move/index', 'el-icon-s-order', 1, 0, 999, NULL, '', 1, 0, 0);
INSERT INTO `qimall_addons_happiness_store_menu` (`id`, `title`, `app_id`, `pid`, `addons_name`, `is_addon`, `url`, `icon`, `level`, `dev`, `sort`, `params`, `tree`, `status`, `created_at`, `updated_at`) VALUES (1, '概况', '0', 0, '', 0, 'happiness/client/index/index', 'el-icon-s-platform', 1, 0, 999, NULL, '', 1, 0, 0);
INSERT INTO `qimall_addons_happiness_store_menu` (`id`, `title`, `app_id`, `pid`, `addons_name`, `is_addon`, `url`, `icon`, `level`, `dev`, `sort`, `params`, `tree`, `status`, `created_at`, `updated_at`) VALUES (2, '商品', '0', 0, '', 0, 'happiness/client/goods/index', 'el-icon-s-goods', 1, 0, 999, NULL, '', 1, 0, 0);
INSERT INTO `qimall_addons_happiness_store_menu` (`id`, `title`, `app_id`, `pid`, `addons_name`, `is_addon`, `url`, `icon`, `level`, `dev`, `sort`, `params`, `tree`, `status`, `created_at`, `updated_at`) VALUES (3, '订单', '0', 0, '', 0, 'happiness/client/order/index', 'el-icon-s-order', 1, 0, 999, NULL, '', 1, 0, 0);
INSERT INTO `qimall_addons_happiness_store_menu` (`id`, `title`, `app_id`, `pid`, `addons_name`, `is_addon`, `url`, `icon`, `level`, `dev`, `sort`, `params`, `tree`, `status`, `created_at`, `updated_at`) VALUES (4, '会员', '0', 0, '', 0, 'happiness/client/user/index', 'el-icon-user', 1, 0, 999, NULL, '', 1, 0, 0);
INSERT INTO `qimall_addons_happiness_store_menu` (`id`, `title`, `app_id`, `pid`, `addons_name`, `is_addon`, `url`, `icon`, `level`, `dev`, `sort`, `params`, `tree`, `status`, `created_at`, `updated_at`) VALUES (5, '资产', '0', 0, '', 0, 'happiness/client/finance/index', 'el-icon-coin', 1, 0, 999, NULL, '', 1, 0, 0);
INSERT INTO `qimall_addons_happiness_store_menu` (`id`, `title`, `app_id`, `pid`, `addons_name`, `is_addon`, `url`, `icon`, `level`, `dev`, `sort`, `params`, `tree`, `status`, `created_at`, `updated_at`) VALUES (6, '设置', '0', 0, '', 0, 'happiness/client/setting/index', 'el-icon-setting', 1, 0, 999, NULL, '', 1, 0, 0);
INSERT INTO `qimall_addons_happiness_store_menu` (`id`, `title`, `app_id`, `pid`, `addons_name`, `is_addon`, `url`, `icon`, `level`, `dev`, `sort`, `params`, `tree`, `status`, `created_at`, `updated_at`) VALUES (7, '商品管理', '0', 2, '', 0, 'happiness/client/goods/index', '', 2, 0, 999, NULL, '', 1, 0, 0);
INSERT INTO `qimall_addons_happiness_store_menu` (`id`, `title`, `app_id`, `pid`, `addons_name`, `is_addon`, `url`, `icon`, `level`, `dev`, `sort`, `params`, `tree`, `status`, `created_at`, `updated_at`) VALUES (8, '订单管理', '0', 3, '', 0, 'happiness/client/order/index', '', 2, 0, 999, NULL, '', 1, 0, 0);
INSERT INTO `qimall_addons_happiness_store_menu` (`id`, `title`, `app_id`, `pid`, `addons_name`, `is_addon`, `url`, `icon`, `level`, `dev`, `sort`, `params`, `tree`, `status`, `created_at`, `updated_at`) VALUES (9, '售后订单', '0', 3, '', 0, 'happiness/client/order/refund', '', 2, 0, 999, NULL, '', 1, 0, 0);
INSERT INTO `qimall_addons_happiness_store_menu` (`id`, `title`, `app_id`, `pid`, `addons_name`, `is_addon`, `url`, `icon`, `level`, `dev`, `sort`, `params`, `tree`, `status`, `created_at`, `updated_at`) VALUES (10, '资产概况', '0', 5, '', 0, 'happiness/client/finance/index', '', 2, 0, 999, NULL, '', 1, 0, 0);
INSERT INTO `qimall_addons_happiness_store_menu` (`id`, `title`, `app_id`, `pid`, `addons_name`, `is_addon`, `url`, `icon`, `level`, `dev`, `sort`, `params`, `tree`, `status`, `created_at`, `updated_at`) VALUES (11, '收入明细', '0', 5, '', 0, 'happiness/client/finance/income-log', '', 2, 0, 999, NULL, '', 1, 0, 0);
INSERT INTO `qimall_addons_happiness_store_menu` (`id`, `title`, `app_id`, `pid`, `addons_name`, `is_addon`, `url`, `icon`, `level`, `dev`, `sort`, `params`, `tree`, `status`, `created_at`, `updated_at`) VALUES (12, '资金提现', '0', 5, '', 0, 'happiness/client/finance/withdrawal', '', 2, 0, 999, NULL, '', 1, 0, 0);
INSERT INTO `qimall_addons_happiness_store_menu` (`id`, `title`, `app_id`, `pid`, `addons_name`, `is_addon`, `url`, `icon`, `level`, `dev`, `sort`, `params`, `tree`, `status`, `created_at`, `updated_at`) VALUES (13, '店铺信息', '0', 6, '', 0, 'happiness/client/setting/index', '', 2, 0, 999, NULL, '', 1, 0, 0);
INSERT INTO `qimall_addons_happiness_store_menu` (`id`, `title`, `app_id`, `pid`, `addons_name`, `is_addon`, `url`, `icon`, `level`, `dev`, `sort`, `params`, `tree`, `status`, `created_at`, `updated_at`) VALUES (14, '核销', '0', 0, '', 0, 'happiness/client/clerk/index', 'el-icon-s-check', 1, 0, 999, NULL, '', 1, 0, 0);
INSERT INTO `qimall_addons_happiness_store_menu` (`id`, `title`, `app_id`, `pid`, `addons_name`, `is_addon`, `url`, `icon`, `level`, `dev`, `sort`, `params`, `tree`, `status`, `created_at`, `updated_at`) VALUES (15, '核销员', '0', 15, '', 0, 'happiness/client/clerk/index', '', 2, 0, 999, NULL, '', 1, 0, 0);
INSERT INTO `qimall_addons_happiness_store_menu` (`id`, `title`, `app_id`, `pid`, `addons_name`, `is_addon`, `url`, `icon`, `level`, `dev`, `sort`, `params`, `tree`, `status`, `created_at`, `updated_at`) VALUES (16, '核销明细', '0', 15, '', 0, 'happiness/client/clerk/clerk-log', '', 2, 0, 999, NULL, '', 1, 0, 0);
INSERT INTO `qimall_addons_happiness_store_menu` (`id`, `title`, `app_id`, `pid`, `addons_name`, `is_addon`, `url`, `icon`, `level`, `dev`, `sort`, `params`, `tree`, `status`, `created_at`, `updated_at`) VALUES (17, '提货管理', '0', 2, '', 0, 'happiness/client/voucher-order/index', '', 2, 0, 999, NULL, '', 1, 0, 0);
INSERT INTO `qimall_diy_components` ( `code`, `title`, `group`, `icon`, `count`, `is_top`, `permission`, `sort`, `source`, `status`, `created_at`, `updated_at`) VALUES ('happiness-store-goods', '幸福小店商品', 'marketing', '', 999, 0, '{\"is_drag\":\"true\",\"is_up\":\"true\",\"id_down\":\"true\",\"is_copy\":\"true\"}', 999, 'Happiness', 1, 1634538238, 1634538238);
INSERT INTO `qimall_diy_components` ( `code`, `title`, `group`, `icon`, `count`, `is_top`, `permission`, `sort`, `source`, `status`, `created_at`, `updated_at`) VALUES ( 'happiness-member-card', '幸福小店会员卡', 'marketing', '', 999, 0, '{\"is_drag\":\"true\",\"is_up\":\"true\",\"id_down\":\"true\",\"is_copy\":\"false\"}', 999, 'Happiness', 1, 0, 0);
