CREATE TABLE IF NOT EXISTS `__PREFIX__service_add_order` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  `user_id` int(10) unsigned NOT NULL COMMENT '用户id',
  `order_id` int(10) unsigned NOT NULL COMMENT '订单id',
  `payprice` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '项目金额',
  `total_cost_seconds` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '时长',
  `paytype` tinyint(1) NOT NULL DEFAULT '0' COMMENT '支付方式:0=微信小程序,1=微信APP,2=公众号支付,3=支付宝APP,4=余额',
  `orderId` varchar(40) NOT NULL COMMENT '订单编号',
  `add_ids` varchar(122) NOT NULL COMMENT '附加项目id集合',
  `trade_no` varchar(40) DEFAULT NULL COMMENT '交易单号',
  `state` tinyint(1) NOT NULL DEFAULT '0' COMMENT '状态:0=待支付,1=支付成功',
  `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  `updatetime` bigint(16) DEFAULT NULL COMMENT '更新时间',
  `paytime` bigint(16) DEFAULT NULL COMMENT '支付时间',
  PRIMARY KEY (`id`),
  KEY `user_id` (`user_id`),
  KEY `order_id` (`order_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='附加项目订单';
CREATE TABLE IF NOT EXISTS `__PREFIX__service_add_order_detail` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  `user_id` int(10) unsigned NOT NULL COMMENT '用户id',
  `order_id` int(10) unsigned NOT NULL COMMENT '订单id',
  `goods_add_id` int(10) unsigned NOT NULL COMMENT '附加项目id',
  `service_add_order_id` int(10) DEFAULT NULL COMMENT '附加项目订单id',
  `name` varchar(40) NOT NULL COMMENT '附加项目名称',
  `num` int(10) unsigned NOT NULL DEFAULT '1' COMMENT '数量',
  `price` decimal(10,2) unsigned NOT NULL COMMENT '附加项目金额',
  `cost_seconds` tinyint(1) unsigned NOT NULL COMMENT '时长',
  `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  `updatetime` bigint(16) DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`),
  KEY `user_id` (`user_id`),
  KEY `order_id` (`order_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='订单附加项目详情';
CREATE TABLE IF NOT EXISTS `__PREFIX__service_address` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  `user_id` int(10) NOT NULL COMMENT '用户id',
  `name` char(20) NOT NULL COMMENT '联系人',
  `sex` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '性别:1=男,0=女',
  `mobile` char(20) NOT NULL COMMENT '联系电话',
  `province` varchar(30) NOT NULL COMMENT '省',
  `city` varchar(30) NOT NULL COMMENT '市',
  `district` varchar(30) DEFAULT NULL COMMENT '县',
  `area` varchar(122) NOT NULL COMMENT '服务地址',
  `address` varchar(255) DEFAULT NULL COMMENT '详细地址',
  `lng` char(20) NOT NULL COMMENT '经度',
  `lat` char(20) NOT NULL COMMENT '纬度',
  `state` tinyint(1) NOT NULL DEFAULT '0' COMMENT '状态:0=非默认,1=默认',
  `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  `updatetime` bigint(16) DEFAULT NULL COMMENT '更新时间',
  `deletetime` bigint(16) DEFAULT NULL COMMENT '删除时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8mb4 COMMENT='地址表';
CREATE TABLE IF NOT EXISTS `__PREFIX__service_apply_shop` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  `user_id` int(10) unsigned NOT NULL COMMENT '商家用户id',
  `applytype` tinyint(1) NOT NULL DEFAULT '0' COMMENT '类型:0=申请,1=完善资料',
  `name` varchar(30) NOT NULL COMMENT '商家名称',
  `abbr` char(20) NOT NULL COMMENT '缩写',
  `type` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '类型:0=企业,1=个体工商户',
  `credit_code` varchar(30) NOT NULL COMMENT '统一社会信用代码',
  `license_image` varchar(122) NOT NULL COMMENT '营业执照',
  `username` char(20) NOT NULL COMMENT '法人姓名',
  `mobile` char(20) NOT NULL COMMENT '法人手机号',
  `idcard` char(20) NOT NULL COMMENT '身份证号',
  `front_image` varchar(122) NOT NULL COMMENT '身份证正面',
  `opposite_image` varchar(122) NOT NULL COMMENT '身份证反面',
  `intro` varchar(255) NOT NULL COMMENT '商家简介',
  `logo_image` varchar(122) NOT NULL COMMENT 'logo',
  `category_ids` varchar(122) NOT NULL COMMENT '经营分类',
  `goods_ids` varchar(500) NOT NULL COMMENT '服务项目',
  `leader_name` char(20) NOT NULL COMMENT '负责人姓名',
  `leader_mobile` char(20) NOT NULL COMMENT '负责人手机号',
  `trade_hour` varchar(122) DEFAULT NULL COMMENT '营业时间',
  `province` varchar(30) NOT NULL COMMENT '省',
  `city` varchar(30) NOT NULL COMMENT '市',
  `district` varchar(50) DEFAULT NULL COMMENT '县',
  `address` varchar(122) NOT NULL COMMENT '详细地址',
  `lng` char(20) NOT NULL COMMENT '经度',
  `lat` char(20) NOT NULL COMMENT '纬度',
  `state` enum('0','1','-1') NOT NULL DEFAULT '0' COMMENT '状态:0=待审核,1=审核通过,-1=审核拒绝',
  `note` varchar(30) DEFAULT NULL COMMENT '拒绝理由',
  `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  `updatetime` bigint(16) DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`),
  KEY `user_id` (`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COMMENT='申请商户表';
CREATE TABLE IF NOT EXISTS `__PREFIX__service_apply_skill` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  `user_id` int(10) unsigned NOT NULL COMMENT '用户id',
  `applytype` tinyint(1) NOT NULL DEFAULT '0' COMMENT '类型:0=申请,1=完善资料',
  `name` char(20) NOT NULL COMMENT '姓名',
  `sex` tinyint(1) NOT NULL DEFAULT '0' COMMENT '性别:1=男,0=女',
  `idcard` char(20) NOT NULL COMMENT '身份证号码',
  `front_image` varchar(122) NOT NULL COMMENT '身份证正面',
  `opposite_image` varchar(122) NOT NULL COMMENT '身份证反面',
  `user_image` varchar(122) NOT NULL COMMENT '实拍照',
  `certificate_image` varchar(122) NOT NULL COMMENT '从业资格证',
  `health_image` varchar(122) NOT NULL COMMENT '健康证',
  `category_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '职业技能id',
  `skill_cate_id` int(10) unsigned NOT NULL COMMENT '服务技能id',
  `goods_ids` varchar(500) NOT NULL COMMENT '服务项目',
  `image` varchar(122) NOT NULL COMMENT '工装照',
  `images` varchar(1500) DEFAULT NULL COMMENT '生活照',
  `edu` tinyint(1) unsigned NOT NULL COMMENT '学历:0=小学文化,1=初中,2=高中,3=大专,4=本科,5=硕士,6=博士',
  `nation` char(20) NOT NULL COMMENT '民族',
  `age` tinyint(1) unsigned NOT NULL COMMENT '年龄',
  `height` tinyint(1) DEFAULT NULL COMMENT '身高/cm',
  `weight` tinyint(1) DEFAULT NULL COMMENT '体重/kg',
  `exper` tinyint(1) NOT NULL DEFAULT '0' COMMENT '经验:0=1年以下,1=1-3年,2=3-5年,3=5年以上',
  `province` varchar(30) NOT NULL COMMENT '省',
  `city` varchar(30) NOT NULL COMMENT '市',
  `district` varchar(50) DEFAULT NULL COMMENT '县',
  `address` varchar(122) NOT NULL COMMENT '详细地址',
  `lng` char(20) NOT NULL COMMENT '经度',
  `lat` char(20) NOT NULL COMMENT '纬度',
  `note` varchar(30) DEFAULT NULL COMMENT '拒绝原因',
  `state` enum('0','1','-1') NOT NULL DEFAULT '0' COMMENT '审核状态:0=待审核,1=审核通过,-1=审核拒绝',
  `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  `updatetime` bigint(16) DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`),
  KEY `city` (`city`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COMMENT='申请服务者';
CREATE TABLE IF NOT EXISTS `__PREFIX__service_category` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  `pid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '上级id',
  `name` varchar(30) NOT NULL DEFAULT '' COMMENT '分类名称',
  `flag` set('hot','new','recommend') NOT NULL DEFAULT '' COMMENT '标志(多选):hot=热门,new=新产品,recommend=推荐',
  `image` varchar(100) NOT NULL DEFAULT '' COMMENT '分类图标',
  `is_show` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否首页显示:0=否,1=是',
  `status` enum('normal','hidden') NOT NULL DEFAULT 'normal' COMMENT '状态',
  `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  `updatetime` bigint(16) DEFAULT NULL COMMENT '更新时间',
  `weigh` int(10) NOT NULL DEFAULT '0' COMMENT '权重',
  PRIMARY KEY (`id`),
  KEY `pid_index` (`pid`),
  KEY `weigh` (`weigh`)
) ENGINE=InnoDB AUTO_INCREMENT=58 DEFAULT CHARSET=utf8mb4 COMMENT='项目分类表';
CREATE TABLE IF NOT EXISTS `__PREFIX__service_city_config` (
  `id` int(10) NOT NULL AUTO_INCREMENT COMMENT 'id',
  `city` varchar(30) NOT NULL COMMENT '城市名',
  `init_price` decimal(5,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '起步价',
  `init_distance` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '起步里程/公里',
  `add_price` decimal(5,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '增加1公里增加费用',
  `bus_start` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '公交车开启时间(24小时制)',
  `bus_end` tinyint(1) NOT NULL DEFAULT '0' COMMENT '公交车结束时间(24小时制)',
  `weigh` int(10) NOT NULL DEFAULT '0' COMMENT '权重',
  `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  `updatetime` bigint(16) DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`),
  UNIQUE KEY `city` (`city`),
  KEY `weigh` (`weigh`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8mb4 COMMENT='城市出行配置表';
CREATE TABLE IF NOT EXISTS `__PREFIX__service_comment` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  `user_id` int(10) unsigned NOT NULL COMMENT '用户id',
  `order_id` int(10) unsigned NOT NULL COMMENT '订单id',
  `skill_id` int(10) DEFAULT NULL COMMENT '服务人员id',
  `shop_id` int(10) DEFAULT NULL COMMENT '商家id',
  `goods_id` int(10) unsigned NOT NULL COMMENT '项目id',
  `score` tinyint(1) unsigned NOT NULL DEFAULT '5' COMMENT '评分',
  `comment_label_ids` varchar(60) DEFAULT NULL COMMENT '评论标签id',
  `comment_label` varchar(255) DEFAULT NULL COMMENT '标签内容',
  `content` text COMMENT '评论内容',
  `images` varchar(800) DEFAULT NULL COMMENT '图片',
  `is_img` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '有图:0=否,1=是',
  `state` tinyint(1) NOT NULL DEFAULT '1' COMMENT '状态:0=隐藏,1=显示',
  `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  `updatetime` bigint(16) DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`),
  UNIQUE KEY `order_id` (`order_id`),
  KEY `goods_id` (`goods_id`),
  KEY `skill_id` (`skill_id`) USING BTREE,
  KEY `shop_id` (`shop_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COMMENT='评论表';
CREATE TABLE IF NOT EXISTS `__PREFIX__service_comment_label` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  `name` varchar(30) NOT NULL COMMENT '标签内容',
  `state` tinyint(1) NOT NULL DEFAULT '1' COMMENT '状态:0=隐藏,1=显示',
  `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  `updatetime` bigint(16) DEFAULT NULL COMMENT '更新时间',
  `deletetime` bigint(16) DEFAULT NULL COMMENT '删除时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COMMENT='评论标签表';
CREATE TABLE IF NOT EXISTS `__PREFIX__service_common_questions` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  `title` varchar(60) NOT NULL COMMENT '问题标题',
  `content` longtext NOT NULL COMMENT '内容',
  `state` tinyint(1) NOT NULL DEFAULT '1' COMMENT '状态:0=隐藏,1=显示',
  `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  `updatetime` bigint(16) DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COMMENT='常见问题表';
CREATE TABLE IF NOT EXISTS `__PREFIX__service_complaint` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  `user_id` int(10) unsigned NOT NULL COMMENT '用户id',
  `order_id` int(10) unsigned NOT NULL COMMENT '订单id',
  `complaint_content` varchar(255) NOT NULL COMMENT '投诉内容',
  `content` text COMMENT '补充内容',
  `images` varchar(500) DEFAULT NULL COMMENT '图片',
  `state` tinyint(1) NOT NULL DEFAULT '0' COMMENT '状态:0=待处理,1=已处理,-1=已拒绝',
  `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  `updatetime` bigint(16) DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`),
  KEY `order_id` (`order_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='投诉表';
CREATE TABLE IF NOT EXISTS `__PREFIX__service_complaint_reason` (
  `id` int(16) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  `name` varchar(60) NOT NULL COMMENT '原因',
  `state` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '状态:0=隐藏,1=显示',
  `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  `updatetime` bigint(16) DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COMMENT='投诉原因表';
CREATE TABLE IF NOT EXISTS `__PREFIX__service_config_text` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  `name` varchar(30) NOT NULL COMMENT '文本名称',
  `content` mediumtext NOT NULL COMMENT '文本名称',
  `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  `updatetime` bigint(16) DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8mb4 COMMENT='富文本表';
CREATE TABLE IF NOT EXISTS `__PREFIX__service_coupon` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  `type` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '优惠券类型:0=平台通用券,1=平台项目券,2=商户通用券,3=商户项目券,4=口令券',
  `goods_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '项目id',
  `shop_id` int(10) NOT NULL DEFAULT '0' COMMENT '商户id',
  `code` char(20) DEFAULT NULL COMMENT '口令',
  `achieve` int(10) unsigned NOT NULL COMMENT '满',
  `reduce` int(10) unsigned NOT NULL COMMENT '减',
  `starttime` bigint(16) NOT NULL COMMENT '展示开始时间',
  `endtime` bigint(16) NOT NULL COMMENT '展示结束时间',
  `effective_day` int(10) unsigned NOT NULL COMMENT '领取后有效期/天',
  `is_check` tinyint(1) NOT NULL DEFAULT '0' COMMENT '审核状态:0=待审核,1=审核通过,-1=审核未通过',
  `note` varchar(100) DEFAULT NULL COMMENT '拒绝原因',
  `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  `updatetime` bigint(16) DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8mb4 COMMENT='优惠券表';
CREATE TABLE IF NOT EXISTS `__PREFIX__service_ensure_log` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  `user_id` int(10) unsigned NOT NULL COMMENT '用户id',
  `money` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '变更保证金',
  `type` tinyint(1) NOT NULL DEFAULT '0' COMMENT '类型:0=服务者,1=商户',
  `memo` varchar(255) NOT NULL COMMENT '备注',
  `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COMMENT='保证金日志';
CREATE TABLE IF NOT EXISTS `__PREFIX__service_feedback` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  `user_id` int(10) unsigned NOT NULL COMMENT '用户id',
  `type` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '类型:0=用户端,1=服务端,2=商户端',
  `content` text NOT NULL COMMENT '反馈内容',
  `images` varchar(1000) DEFAULT NULL COMMENT '图片',
  `mobile` char(20) DEFAULT NULL COMMENT '手机号',
  `state` tinyint(1) NOT NULL DEFAULT '0' COMMENT '状态:0=待处理,1=已处理',
  `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  `updatetime` bigint(16) DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='反馈意见表';
CREATE TABLE IF NOT EXISTS `__PREFIX__service_follow` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  `user_id` int(10) unsigned NOT NULL COMMENT '用户id',
  `type` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '类型:0=服务者,1=服务项目,2=商家',
  `follow_id` int(10) unsigned NOT NULL COMMENT '被关注id',
  `state` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '状态:0=取消关注,1=关注',
  `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  `updatetime` bigint(16) DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COMMENT='关注表';
CREATE TABLE IF NOT EXISTS `__PREFIX__service_goods` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  `name` varchar(30) NOT NULL COMMENT '项目名称',
  `category_id` int(10) unsigned NOT NULL COMMENT '一级分类',
  `two_category_id` int(10) unsigned NOT NULL COMMENT '二级分类',
  `skill_cate_ids` varchar(60) NOT NULL COMMENT '所属服务人员分类',
  `shop_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '商户id',
  `shop_user_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '商户的用户id',
  `type` tinyint(1) NOT NULL DEFAULT '0' COMMENT '项目类型:0=平台项目,1=商户项目',
  `province` char(20) DEFAULT NULL COMMENT '省',
  `city` char(20) DEFAULT NULL COMMENT '市',
  `district` char(30) DEFAULT NULL COMMENT '县',
  `to_shop` set('door','shop') DEFAULT 'door' COMMENT '服务方式:door=上门服务,shop=到店核销',
  `is_travel` tinyint(1) NOT NULL DEFAULT '0' COMMENT '开启出行:0=否,1=是',
  `tag_name` varchar(60) DEFAULT NULL COMMENT '项目标签',
  `image` varchar(100) NOT NULL COMMENT '项目主图',
  `images` varchar(1500) NOT NULL COMMENT '项目轮播图',
  `price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '项目价格',
  `start_hour` tinyint(1) NOT NULL DEFAULT '6' COMMENT '预约开始(0-23时)',
  `end_hour` tinyint(1) NOT NULL DEFAULT '18' COMMENT '预约结束(0-23时)',
  `cost_seconds` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '时长/分钟',
  `response_hour` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '最快响应时间/小时',
  `spec_type` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '规格类型:0=单规格,1=多规格',
  `choose_skill_type` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '选择技师:0=否,1=是',
  `flow_path_images` varchar(1500) NOT NULL COMMENT '服务流程',
  `illustrate_images` varchar(1500) NOT NULL COMMENT '服务说明',
  `salenums` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '销量',
  `shop_state` tinyint(1) NOT NULL DEFAULT '0' COMMENT '商户项目状态:0=待审核,1=审核通过,-1=审核拒绝',
  `status` enum('normal','hidden') NOT NULL DEFAULT 'normal' COMMENT '上架状态:normal=上架,hidden=下架',
  `note` varchar(100) DEFAULT NULL COMMENT '拒绝原因',
  `weigh` int(10) DEFAULT '0' COMMENT '权重',
  `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  `updatetime` bigint(16) DEFAULT NULL COMMENT '更新时间',
  `deletetime` bigint(16) DEFAULT NULL COMMENT '删除时间',
  PRIMARY KEY (`id`),
  KEY `salesnum` (`salenums`),
  KEY `category1` (`category_id`),
  KEY `category2` (`two_category_id`),
  KEY `price` (`price`),
  KEY `shop_id` (`shop_id`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COMMENT='项目表';
CREATE TABLE IF NOT EXISTS `__PREFIX__service_goods_add` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  `goods_id` int(10) NOT NULL COMMENT '所属项目id',
  `name` varchar(60) NOT NULL COMMENT '附加项目名称',
  `price` decimal(10,2) NOT NULL COMMENT '价格',
  `cost_seconds` int(10) unsigned NOT NULL COMMENT '时长/分钟',
  `state` tinyint(1) NOT NULL DEFAULT '1' COMMENT '状态:0=隐藏,1=显示',
  `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  `updatetime` bigint(16) DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='附加项目表';
CREATE TABLE IF NOT EXISTS `__PREFIX__service_goods_sku` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  `goods_id` int(10) unsigned DEFAULT NULL COMMENT '商品id',
  `type` tinyint(1) NOT NULL DEFAULT '0' COMMENT '项目类型:0=普通项目,1=可入套餐项目',
  `name` varchar(50) NOT NULL COMMENT '规格名称',
  `price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '价格',
  `cost_seconds` int(10) unsigned NOT NULL COMMENT '时长/分钟',
  `salenums` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '销量',
  `status` enum('normal','hidden') NOT NULL DEFAULT 'normal' COMMENT '状态:hidden=未使用,normal=使用中',
  `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  `updatetime` bigint(16) DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`),
  KEY `goods_id` (`goods_id`)
) ENGINE=InnoDB AUTO_INCREMENT=26 DEFAULT CHARSET=utf8mb4 COMMENT='商品sku表';
CREATE TABLE IF NOT EXISTS `__PREFIX__service_goods_spu` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  `goods_id` int(10) NOT NULL COMMENT '商品id',
  `name` varchar(50) NOT NULL COMMENT '规格名称',
  `skudetail` varchar(500) NOT NULL COMMENT '规格详情',
  `status` enum('normal','hidden') NOT NULL DEFAULT 'normal' COMMENT '状态:hidden=隐藏,normal=正常',
  `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  `updatetime` bigint(16) DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8mb4 COMMENT='商品spu';
CREATE TABLE IF NOT EXISTS `__PREFIX__service_join_shop` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  `skill_id` int(10) unsigned NOT NULL COMMENT '服务人员id',
  `skill_name` char(20) NOT NULL COMMENT '服务人员姓名',
  `shop_id` int(10) unsigned NOT NULL COMMENT '商户id',
  `shop_name` varchar(40) NOT NULL COMMENT '商家名称',
  `code` char(10) NOT NULL COMMENT '商家码',
  `state` tinyint(1) NOT NULL DEFAULT '0' COMMENT '状态:0=待审核,1=审核通过,-1=审核拒绝',
  `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  `updatetime` bigint(16) DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COMMENT='申请加入门店';
CREATE TABLE IF NOT EXISTS `__PREFIX__service_jump` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  `name` varchar(30) NOT NULL COMMENT '链接名称',
  `url` varchar(30) NOT NULL COMMENT '跳转链接',
  `state` tinyint(1) NOT NULL DEFAULT '1' COMMENT '状态:0=隐藏,1=显示',
  `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  `updatetime` bigint(16) DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='跳转链接';
CREATE TABLE IF NOT EXISTS `__PREFIX__service_mini_template` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  `user_notice_template` varchar(500) DEFAULT NULL COMMENT '接单通知',
  `user_order_template` varchar(500) DEFAULT NULL COMMENT '订单状态通知',
  `order_finish_template` varchar(500) DEFAULT NULL COMMENT '订单完成推送用户',
  `user_sales_template` varchar(500) DEFAULT NULL COMMENT '售后处理通知',
  `user_complaint_template` varchar(500) DEFAULT NULL COMMENT '用户投诉结果通知',
  `skill_order_template` varchar(500) DEFAULT NULL COMMENT '服务者订单通知',
  `skill_sales_template` varchar(500) DEFAULT NULL COMMENT '服务者售后订单通知',
  `shop_order_template` varchar(500) DEFAULT NULL COMMENT '商户新订单通知',
  `shop_finish_template` varchar(500) DEFAULT NULL COMMENT '商户订单完成通知',
  `shop_sales_template` varchar(500) DEFAULT NULL COMMENT '商户售后通知',
  `state` tinyint(1) NOT NULL DEFAULT '1' COMMENT '状态:0=隐藏,1=显示',
  `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  `updatetime` bigint(16) DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COMMENT='微信推送配置';
CREATE TABLE IF NOT EXISTS `__PREFIX__service_notice` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  `title` varchar(60) NOT NULL COMMENT '标题',
  `type` tinyint(1) NOT NULL DEFAULT '0' COMMENT '类型:0=用户端,1=服务端,2=商户端',
  `image` varchar(122) NOT NULL COMMENT '封面图',
  `content` mediumtext NOT NULL COMMENT '内容',
  `weigh` int(10) NOT NULL DEFAULT '0' COMMENT '权重',
  `state` tinyint(1) NOT NULL DEFAULT '1' COMMENT '状态:0=隐藏,1=显示',
  `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  `updatetime` bigint(16) DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COMMENT='平台公告表';
CREATE TABLE IF NOT EXISTS `__PREFIX__service_order` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  `user_id` int(10) unsigned NOT NULL COMMENT '用户id',
  `ordertype` tinyint(1) NOT NULL DEFAULT '0' COMMENT '订单类型:0=普通订单,1=套餐订单',
  `package_order_id` int(10) DEFAULT NULL COMMENT '套餐卡订单id',
  `leader_id` int(10) DEFAULT '0' COMMENT '上级分销商id',
  `rec_leader_id` int(10) NOT NULL DEFAULT '0' COMMENT '上上级分销商id',
  `skill_id` int(10) DEFAULT NULL COMMENT '服务者id',
  `shop_id` int(10) DEFAULT NULL COMMENT '商户id',
  `goods_id` int(10) unsigned NOT NULL COMMENT '项目id',
  `traveltype` tinyint(1) NOT NULL DEFAULT '0' COMMENT '出行方式:0=免费出行,1=出租车,2=公交',
  `choose_skill_type` tinyint(1) NOT NULL DEFAULT '1' COMMENT '选择技师:0=否,1=是',
  `paytype` tinyint(1) NOT NULL DEFAULT '0' COMMENT '支付方式:0=微信小程序,1=微信APP,2=公众号支付,3=支付宝APP,4=余额',
  `to_shop` enum('door','shop') NOT NULL DEFAULT 'door' COMMENT '服务方式:door=上门服务,shop=到店核销',
  `orderId` varchar(40) NOT NULL COMMENT '订单编号',
  `city` varchar(30) NOT NULL COMMENT '城市',
  `price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '项目金额',
  `distance` float(8,2) NOT NULL DEFAULT '0.00' COMMENT '距离/km',
  `travel_price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '出行费用',
  `sumprice` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '总金额',
  `goods_total_price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '项目实际总金额',
  `discount` tinyint(1) unsigned NOT NULL DEFAULT '100' COMMENT '折扣%',
  `coupon_id` int(10) DEFAULT NULL COMMENT '优惠券id',
  `coupon_price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '优惠券金额',
  `premium_price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '补价',
  `add_price` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '附加项目金额',
  `payprice` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '支付金额',
  `act_travel_price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '实际结算车费',
  `refund_price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '退款金额',
  `settle_price` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '结算金额',
  `total_cost_seconds` int(10) unsigned DEFAULT NULL COMMENT '项目总时长',
  `starttime` bigint(16) DEFAULT NULL COMMENT '开始时间',
  `endtime` bigint(16) DEFAULT NULL COMMENT '结束时间',
  `actendtime` bigint(16) DEFAULT NULL COMMENT '实际结束时间',
  `trade_no` varchar(30) DEFAULT NULL COMMENT '交易单号',
  `memo` varchar(100) DEFAULT NULL COMMENT '订单备注',
  `qrcode_image` varchar(122) DEFAULT NULL COMMENT '核销码',
  `check_name` char(20) DEFAULT NULL COMMENT '核销码内容',
  `is_service` tinyint(1) NOT NULL DEFAULT '0' COMMENT '售后状态:0=未售后,1=售后中,2=已退款,-1=已拒绝',
  `is_complaint` tinyint(1) NOT NULL DEFAULT '0' COMMENT '投诉状态:0=未投诉,1=已投诉',
  `is_pool` tinyint(1) NOT NULL DEFAULT '0' COMMENT '订单池:0=否,1=是',
  `is_settle` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '状态:0=未结算,1=待结算,2=已结算',
  `skill_percent` tinyint(1) NOT NULL DEFAULT '0' COMMENT '服务者分佣比例',
  `shop_percent` tinyint(1) NOT NULL DEFAULT '0' COMMENT '商户分佣比例',
  `skill_price` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '服务者佣金',
  `shop_price` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '门店佣金',
  `platform_price` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '平台收益',
  `leader_price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '直推分佣',
  `rec_leader_price` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '间推分佣',
  `dis_price` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '分销金额',
  `reach_images` varchar(1000) DEFAULT NULL COMMENT '到达拍照',
  `finish_images` varchar(1000) DEFAULT NULL COMMENT '完成服务拍照',
  `status` tinyint(1) NOT NULL DEFAULT '0' COMMENT '订单状态:0=待支付,1=待接单,2=待出发,3=已出发,4=已到达,5=服务中,6=已完成,7=已评价,-1=已取消',
  `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  `updatetime` bigint(16) DEFAULT NULL COMMENT '更新时间',
  `paytime` bigint(16) DEFAULT NULL COMMENT '支付时间',
  `accepttime` bigint(16) DEFAULT NULL COMMENT '接单时间',
  `gotime` bigint(16) DEFAULT NULL COMMENT '出发时间',
  `reachtime` bigint(16) DEFAULT NULL COMMENT '到达时间',
  `servicetime` bigint(16) DEFAULT NULL COMMENT '开始服务时间',
  `finishtime` bigint(16) DEFAULT NULL COMMENT '服务完成时间',
  `settletime` bigint(16) DEFAULT NULL COMMENT '结算时间',
  `deletetime` bigint(16) DEFAULT NULL COMMENT '删除时间',
  PRIMARY KEY (`id`),
  UNIQUE KEY `user_unique` (`user_id`,`createtime`),
  KEY `user_id` (`user_id`),
  KEY `skill_id` (`skill_id`),
  KEY `shop_id` (`shop_id`),
  KEY `status` (`status`),
  KEY `is_service` (`is_service`),
  KEY `is_settle` (`is_settle`),
  KEY `goods_id` (`goods_id`)
) ENGINE=InnoDB AUTO_INCREMENT=29 DEFAULT CHARSET=utf8mb4 COMMENT='订单表';
CREATE TABLE IF NOT EXISTS `__PREFIX__service_order_address` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  `user_id` int(10) unsigned NOT NULL COMMENT '用户id',
  `order_id` int(10) unsigned NOT NULL COMMENT '订单id',
  `name` char(20) NOT NULL COMMENT '姓名',
  `sex` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '性别:1=男,0=女',
  `mobile` char(20) NOT NULL COMMENT '手机号',
  `province` varchar(30) NOT NULL COMMENT '省',
  `city` varchar(30) NOT NULL COMMENT '市',
  `district` varchar(50) NOT NULL COMMENT '县',
  `address` varchar(122) NOT NULL COMMENT '详细地址',
  `area` varchar(255) NOT NULL COMMENT '服务地址',
  `lng` char(20) NOT NULL COMMENT '经度',
  `lat` char(20) NOT NULL COMMENT '纬度',
  `state` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '状态:0=已取消,1=使用中',
  `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  `updatetime` bigint(16) DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`),
  KEY `order_id` (`order_id`)
) ENGINE=InnoDB AUTO_INCREMENT=29 DEFAULT CHARSET=utf8mb4 COMMENT='订单地址';
CREATE TABLE IF NOT EXISTS `__PREFIX__service_order_detail` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  `user_id` int(10) unsigned NOT NULL COMMENT '用户id',
  `order_id` int(10) unsigned NOT NULL COMMENT '订单id',
  `goods_id` int(10) unsigned NOT NULL COMMENT '项目id',
  `goods_sku_id` int(10) DEFAULT NULL COMMENT '项目规格id',
  `skill_id` int(10) DEFAULT NULL COMMENT '服务人员id',
  `name` varchar(30) NOT NULL COMMENT '项目名称',
  `image` varchar(122) DEFAULT NULL COMMENT '项目图片',
  `sku_name` varchar(30) DEFAULT NULL COMMENT '规格名称',
  `num` int(10) unsigned NOT NULL DEFAULT '1' COMMENT '项目数量',
  `price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '项目单价',
  `sumprice` decimal(10,2) unsigned DEFAULT '0.00' COMMENT '项目总价',
  `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  `updatetime` bigint(16) DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`),
  KEY `order_id` (`order_id`)
) ENGINE=InnoDB AUTO_INCREMENT=29 DEFAULT CHARSET=utf8mb4 COMMENT='订单详情表';
CREATE TABLE IF NOT EXISTS `__PREFIX__service_order_log` (
  `id` int(10) NOT NULL AUTO_INCREMENT COMMENT 'id',
  `order_id` int(10) unsigned NOT NULL COMMENT '订单id',
  `user_id` int(10) unsigned NOT NULL COMMENT '订单用户id',
  `type` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '订单状态:0=创建订单,1=已支付,2=服务者已接单,3=已出发,4=已到达,5=服务中,6=已完成,7=已评价,8=申请退款,9=已退款,10=申请退款拒绝,11=订单投诉,12=订单补差价,13=订单添加附加项目,14=订单已分配,15=商户已接单,16=平台已分配,17=用户取消申请退款,18=投诉已处理',
  `content` text NOT NULL COMMENT '内容',
  `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  `updatetime` bigint(16) DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`),
  KEY `user_id` (`order_id`)
) ENGINE=InnoDB AUTO_INCREMENT=79 DEFAULT CHARSET=utf8mb4 COMMENT='订单日志';
CREATE TABLE IF NOT EXISTS `__PREFIX__service_package_card` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  `name` varchar(122) NOT NULL COMMENT '套餐名称',
  `images` varchar(1000) NOT NULL COMMENT '套餐图片',
  `original_price` decimal(10,2) unsigned NOT NULL COMMENT '套餐原价',
  `price` decimal(10,2) unsigned NOT NULL COMMENT '现价',
  `info_images` varchar(1500) NOT NULL COMMENT '套餐详情',
  `flow_images` varchar(1500) NOT NULL COMMENT '套餐流程',
  `refund_content` text NOT NULL COMMENT '退订说明',
  `daynums` int(10) unsigned NOT NULL COMMENT '有效天数(0=无限)',
  `plus_state` tinyint(1) NOT NULL DEFAULT '0' COMMENT '参与会员折扣:0=否,1=是',
  `show_state` tinyint(1) NOT NULL DEFAULT '0' COMMENT '产品详情页展示:0=否,1=是',
  `coupon_state` tinyint(1) NOT NULL DEFAULT '0' COMMENT '使用优惠券:0=否,1=是',
  `salenums` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '销量',
  `weigh` int(10) NOT NULL DEFAULT '0' COMMENT '权重',
  `status` enum('normal','hidden') NOT NULL DEFAULT 'normal' COMMENT '状态:normal=上架,hidden=下架',
  `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  `updatetime` bigint(16) DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COMMENT='套餐卡';
CREATE TABLE IF NOT EXISTS `__PREFIX__service_package_goods` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  `package_card_id` int(10) unsigned NOT NULL COMMENT '套餐卡id',
  `goods_id` int(10) unsigned NOT NULL COMMENT '项目id',
  `goods_sku_id` int(10) NOT NULL COMMENT '商品规格id',
  `goodsname` varchar(30) NOT NULL COMMENT '商品名称',
  `name` varchar(50) NOT NULL COMMENT '规格名称',
  `original_price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '原价',
  `price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '套餐价',
  `cost_seconds` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '时长/分钟',
  `unit` char(20) DEFAULT NULL COMMENT '单位',
  `nums` int(10) unsigned NOT NULL COMMENT '套餐次数',
  `total_price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '总价',
  `status` enum('normal','hidden') NOT NULL DEFAULT 'normal' COMMENT '状态:hidden=未使用,normal=使用中',
  `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  `updatetime` bigint(16) DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8mb4 COMMENT='套餐商品表';
CREATE TABLE IF NOT EXISTS `__PREFIX__service_package_order` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  `user_id` int(10) unsigned NOT NULL COMMENT '用户id',
  `package_card_id` int(10) unsigned NOT NULL COMMENT '套餐id',
  `name` varchar(40) NOT NULL COMMENT '套餐名称',
  `image` varchar(122) DEFAULT NULL COMMENT '套餐图片',
  `paytype` tinyint(1) NOT NULL DEFAULT '0' COMMENT '支付方式:0=微信小程序,1=微信APP,2=公众号支付,3=支付宝APP,4=余额',
  `orderId` varchar(40) NOT NULL COMMENT '订单编号',
  `original_price` decimal(10,2) unsigned DEFAULT '0.00' COMMENT '套餐原价',
  `price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '现价',
  `discount` tinyint(1) unsigned NOT NULL DEFAULT '100' COMMENT '折扣%',
  `coupon_id` int(10) DEFAULT NULL COMMENT '优惠券id',
  `coupon_price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '优惠券金额',
  `payprice` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '支付金额',
  `total_refund_price` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '最多退款金额',
  `refund_price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '实际退款金额',
  `starttime` bigint(16) DEFAULT NULL COMMENT '套餐开始时间(空为永久)',
  `endtime` bigint(16) DEFAULT NULL COMMENT '套餐结束时间(空为永久)',
  `trade_no` varchar(40) DEFAULT NULL COMMENT '交易单号',
  `is_service` tinyint(1) NOT NULL DEFAULT '0' COMMENT '售后状态:0=未售后,1=售后中,2=已退款,-1=已拒绝',
  `original_status` tinyint(1) NOT NULL DEFAULT '0' COMMENT '原先状态',
  `note` varchar(60) DEFAULT NULL COMMENT '拒绝原因',
  `is_update` tinyint(1) NOT NULL DEFAULT '0' COMMENT '更新时间:0=未更新,1=已更新',
  `total_nums` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '总次数',
  `use_nums` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '已使用次数',
  `status` tinyint(1) NOT NULL DEFAULT '0' COMMENT '状态:0=待支付,1=已支付,-1=已失效,2=已完成,-2=退款中,-3=已退款',
  `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  `paytime` bigint(16) DEFAULT NULL COMMENT '支付时间',
  `updatetime` bigint(16) DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`),
  KEY `user_id` (`user_id`),
  KEY `package_card_id` (`package_card_id`)
) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8mb4 COMMENT='套餐卡订单';
CREATE TABLE IF NOT EXISTS `__PREFIX__service_package_order_detail` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  `package_order_id` int(10) unsigned NOT NULL COMMENT '套餐订单id',
  `user_id` int(10) unsigned NOT NULL COMMENT '用户id',
  `goods_id` int(10) unsigned NOT NULL COMMENT '项目id',
  `goods_sku_id` int(10) unsigned NOT NULL COMMENT '商品规格id',
  `goodsname` varchar(30) NOT NULL COMMENT '商品名称',
  `name` varchar(50) NOT NULL COMMENT '规格名称',
  `price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '项目价格',
  `act_price` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '实际价格',
  `total_price` decimal(10,2) DEFAULT '0.00' COMMENT '总价',
  `cost_seconds` int(10) NOT NULL DEFAULT '0' COMMENT '时长/分钟',
  `unit` char(20) DEFAULT NULL COMMENT '单位',
  `nums` int(10) NOT NULL COMMENT '次数',
  `usenums` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '使用次数',
  `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  `updatetime` bigint(16) DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=70 DEFAULT CHARSET=utf8mb4 COMMENT='套餐订单项目详情';
CREATE TABLE IF NOT EXISTS `__PREFIX__service_plus_config` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  `name` varchar(30) NOT NULL COMMENT '会员名称',
  `daynums` int(3) unsigned NOT NULL COMMENT '有效天数',
  `original_price` decimal(8,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '原价',
  `price` decimal(8,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '现价',
  `discount` tinyint(1) unsigned NOT NULL COMMENT '享受折扣%',
  `state` tinyint(1) NOT NULL DEFAULT '1' COMMENT '状态:0=隐藏,1=显示',
  `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  `updatetime` bigint(16) DEFAULT NULL COMMENT '更新时间',
  `deletetime` bigint(16) DEFAULT NULL COMMENT '删除时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COMMENT='会员配置';
CREATE TABLE IF NOT EXISTS `__PREFIX__service_plus_pay` (
  `id` int(10) NOT NULL AUTO_INCREMENT COMMENT 'id',
  `user_id` int(10) NOT NULL COMMENT '用户id',
  `plus_id` int(10) unsigned NOT NULL COMMENT '选取配置id',
  `price` decimal(8,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '支付金额',
  `orderId` varchar(40) NOT NULL COMMENT '订单编号',
  `trade_no` varchar(30) DEFAULT NULL COMMENT '交易单号',
  `paytype` tinyint(1) NOT NULL DEFAULT '0' COMMENT '支付类型:0=微信小程序,1=微信APP,2=公众号支付,3=支付宝支付',
  `is_update` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '状态:0=会员未更新,1=会员已更新',
  `state` tinyint(1) NOT NULL DEFAULT '0' COMMENT '状态:0=待支付,1=支付成功',
  `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  `paytime` bigint(16) DEFAULT NULL COMMENT '支付时间',
  `updatetime` bigint(16) DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4 COMMENT='会员支付';
CREATE TABLE IF NOT EXISTS `__PREFIX__service_premium_order` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  `user_id` int(10) unsigned NOT NULL COMMENT '用户id',
  `order_id` int(10) unsigned NOT NULL COMMENT '订单id',
  `paytype` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '支付方式:0=微信小程序,1=微信APP,2=公众号支付,3=支付宝APP,4=余额',
  `payprice` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '补充价',
  `orderId` varchar(40) NOT NULL COMMENT '订单编号',
  `trade_no` varchar(40) DEFAULT NULL COMMENT '交易单号',
  `state` tinyint(1) NOT NULL DEFAULT '0' COMMENT '状态:0=待支付,1=支付成功',
  `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  `updatetime` bigint(16) DEFAULT NULL COMMENT '更新时间',
  `paytime` bigint(16) DEFAULT NULL COMMENT '支付时间',
  PRIMARY KEY (`id`),
  KEY `user_id` (`user_id`),
  KEY `order_id` (`order_id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COMMENT='补差价表';
CREATE TABLE IF NOT EXISTS `__PREFIX__service_project_config` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  `service_mobile` char(20) DEFAULT NULL COMMENT '客服电话',
  `cooperate_mobile` char(20) DEFAULT NULL COMMENT '合作电话',
  `user_notice` varchar(255) DEFAULT NULL COMMENT '用户端小广播',
  `skill_notice` varchar(255) DEFAULT NULL COMMENT '服务端小广播',
  `shop_notice` varchar(255) DEFAULT NULL COMMENT '商家端小广播',
  `refund_notice` varchar(122) DEFAULT NULL COMMENT '退款注意事项',
  `head_image` varchar(122) DEFAULT NULL COMMENT '默认头像',
  `user_privacy_info_id` int(10) DEFAULT NULL COMMENT '用户端隐私政策',
  `user_agreement_info_id` int(10) DEFAULT NULL COMMENT '用户端用户协议',
  `service_privacy_info_id` int(10) DEFAULT NULL COMMENT '服务端隐私政策',
  `service_agreement_info_id` int(10) DEFAULT NULL COMMENT '服务端用户协议',
  `shop_privacy_info_id` int(10) DEFAULT NULL COMMENT '商家端隐私政策',
  `shop_agreement_info_id` int(10) DEFAULT NULL COMMENT '商家端用户协议',
  `plus_info_id` int(10) DEFAULT NULL COMMENT '充值会员须知',
  `service_ensure_info_id` int(10) DEFAULT NULL COMMENT '服务端保证金',
  `shop_ensure_info_id` int(10) DEFAULT NULL COMMENT '商家端保证金',
  `skill_equity_info_id` int(10) DEFAULT NULL COMMENT '服务者保证金权益',
  `shop_equity_info_id` int(10) DEFAULT NULL COMMENT '商户端保证金权益',
  `recharge_info_id` int(10) DEFAULT NULL COMMENT '充值须知',
  `withdraw_info_id` int(10) DEFAULT NULL COMMENT '提现须知',
  `exchange_info_id` int(10) DEFAULT NULL COMMENT '兑换须知',
  `settle_day` int(5) unsigned NOT NULL DEFAULT '1' COMMENT '平台订单结算日期',
  `cancel_minute` int(10) unsigned NOT NULL COMMENT '超时未支付取消',
  `comment_day` tinyint(1) unsigned NOT NULL COMMENT '超时未评价',
  `withdrawtype` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '提现方式:0=月,1=周',
  `accept_nums` int(10) unsigned NOT NULL DEFAULT '1' COMMENT '默认服务者接单数',
  `shop_accept_nums` int(10) unsigned NOT NULL DEFAULT '1' COMMENT '默认商户可接单数',
  `service_nums` int(10) unsigned NOT NULL DEFAULT '1' COMMENT '默认商家服务者数量',
  `day` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '具体提现日期',
  `user_image` varchar(122) DEFAULT NULL COMMENT '用户端logo',
  `user_name` varchar(122) DEFAULT NULL COMMENT '用户端名称',
  `user_intro` varchar(255) DEFAULT NULL COMMENT '用户端描述',
  `skill_image` varchar(122) DEFAULT NULL COMMENT '服务端logo',
  `skill_name` varchar(122) DEFAULT NULL COMMENT '服务端名称',
  `skill_intro` varchar(255) DEFAULT NULL COMMENT '服务端描述',
  `shop_image` varchar(122) DEFAULT NULL COMMENT '商户端logo',
  `shop_name` varchar(122) DEFAULT NULL COMMENT '商户端名称',
  `shop_intro` varchar(255) DEFAULT NULL COMMENT '商户端简介',
  `home_notice_image` varchar(122) DEFAULT NULL COMMENT '首页通知图片',
  `home_notice_word` text COMMENT '首页通知文字',
  `home_notice_url` varchar(122) DEFAULT NULL COMMENT '首页通知跳转链接',
  `state` tinyint(1) NOT NULL DEFAULT '1' COMMENT '状态:0=取消,1=使用',
  `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  `updatetime` bigint(16) DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`),
  KEY `state` (`state`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COMMENT='项目配置表';
CREATE TABLE IF NOT EXISTS `__PREFIX__service_project_configure` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  `userappid` varchar(40) DEFAULT NULL COMMENT '用户端appid',
  `usersecret` varchar(40) DEFAULT NULL COMMENT '用户端secret',
  `skillappid` varchar(40) DEFAULT NULL COMMENT '服务端appid',
  `skillsecret` varchar(40) DEFAULT NULL COMMENT '服务端secret',
  `shopappid` varchar(40) DEFAULT NULL COMMENT '商户端appid',
  `shopsecret` varchar(40) DEFAULT NULL COMMENT '商户端secret',
  `gaodekey` varchar(40) DEFAULT NULL COMMENT '高德key',
  `state` tinyint(1) NOT NULL DEFAULT '1' COMMENT '状态:0=暂停中,1=使用中',
  `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  `updatetime` bigint(16) DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`),
  KEY `state` (`state`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COMMENT='项目配置';
CREATE TABLE IF NOT EXISTS `__PREFIX__service_rebate` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  `user_id` int(10) unsigned NOT NULL COMMENT '用户id',
  `from_user_id` int(10) unsigned NOT NULL COMMENT '来源用户id',
  `type` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '类型:0=服务者佣金,1=商户商户佣金',
  `order_id` int(10) DEFAULT NULL COMMENT '订单id',
  `num` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '返佣金额',
  `rebatetype` tinyint(1) NOT NULL DEFAULT '0' COMMENT '佣金来源:0=平台,1=门店,2=车费',
  `memo` varchar(255) DEFAULT NULL COMMENT '备注',
  `state` tinyint(1) NOT NULL DEFAULT '0' COMMENT '状态:0=待结算,1=已结算',
  `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  `updatetime` bigint(16) DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`),
  KEY `user_id` (`user_id`),
  KEY `order_id` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=30 DEFAULT CHARSET=utf8mb4 COMMENT='返佣记录表';
CREATE TABLE IF NOT EXISTS `__PREFIX__service_rebate_money_log` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  `user_id` int(10) unsigned NOT NULL COMMENT '用户id',
  `money` char(20) NOT NULL COMMENT '变更金额',
  `order_id` int(10) DEFAULT NULL COMMENT '订单id',
  `memo` varchar(255) DEFAULT NULL COMMENT '备注',
  `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8mb4 COMMENT='佣金记录表';
CREATE TABLE IF NOT EXISTS `__PREFIX__service_recharge` (
  `id` int(10) NOT NULL AUTO_INCREMENT COMMENT 'id',
  `user_id` int(10) unsigned NOT NULL COMMENT '用户id',
  `recharge_package_id` int(10) unsigned NOT NULL COMMENT '充值套餐id',
  `price` decimal(8,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '充值金额',
  `gift_price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '赠送金额',
  `orderId` varchar(40) NOT NULL COMMENT '订单编号',
  `trade_no` varchar(40) DEFAULT NULL COMMENT '交易单号',
  `paytype` tinyint(1) NOT NULL DEFAULT '0' COMMENT '支付类型:0=微信小程序,1=微信APP,2=公众号支付,3=支付宝支付',
  `state` tinyint(1) NOT NULL DEFAULT '0' COMMENT '状态:0=待支付,1=支付成功',
  `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  `paytime` bigint(16) DEFAULT NULL COMMENT '支付时间',
  `updatetime` bigint(16) DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='充值表';
CREATE TABLE IF NOT EXISTS `__PREFIX__service_recharge_package` (
  `id` int(10) NOT NULL AUTO_INCREMENT COMMENT 'id',
  `price` decimal(10,2) unsigned NOT NULL COMMENT '充值金额',
  `gift_price` decimal(10,2) unsigned NOT NULL COMMENT '赠送金额',
  `state` tinyint(1) NOT NULL DEFAULT '1' COMMENT '状态:0=隐藏,1=显示',
  `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  `updatetime` bigint(16) DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COMMENT='充值套餐表';
CREATE TABLE IF NOT EXISTS `__PREFIX__service_refund_order` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  `user_id` int(10) unsigned NOT NULL COMMENT '用户id',
  `order_id` int(10) unsigned NOT NULL COMMENT '订单id',
  `refund_reason` varchar(100) NOT NULL COMMENT '退款原因',
  `refund_price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '退款金额',
  `images` varchar(500) DEFAULT NULL COMMENT '图片',
  `content` mediumtext COMMENT '补充原因',
  `is_dec` tinyint(1) NOT NULL DEFAULT '0' COMMENT '扣除保证金:0=否,1=是',
  `state` tinyint(1) NOT NULL DEFAULT '0' COMMENT '状态:0=待审核,1=审核通过,-1=审核拒绝,-2=已取消',
  `note` varchar(122) DEFAULT NULL COMMENT '拒绝原因',
  `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  `updatetime` bigint(16) DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COMMENT='订单退款表';
CREATE TABLE IF NOT EXISTS `__PREFIX__service_refund_reason` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  `name` varchar(80) NOT NULL COMMENT '原因',
  `state` tinyint(1) NOT NULL DEFAULT '1' COMMENT '状态:0=隐藏,1=显示',
  `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  `updatetime` bigint(16) DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COMMENT='退款原因表';
CREATE TABLE IF NOT EXISTS `__PREFIX__service_search_log` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  `user_id` int(10) unsigned NOT NULL COMMENT '用户id',
  `name` varchar(60) NOT NULL COMMENT '搜索内容',
  `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  `updatetime` bigint(16) DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`),
  KEY `user_id` (`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COMMENT='搜索日志表';
CREATE TABLE IF NOT EXISTS `__PREFIX__service_shop` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  `user_id` int(10) unsigned NOT NULL COMMENT '商家用户id',
  `to_shop` tinyint(1) NOT NULL DEFAULT '0' COMMENT '开启到店:0=否,1=是',
  `ensure_id` int(10) DEFAULT NULL COMMENT '保证金id',
  `ensure_price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '保证金',
  `ensure_name` varchar(30) DEFAULT NULL COMMENT '保证金等级名称',
  `accept_nums` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '每日可接单数量',
  `already_accept_nums` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '已接单数量',
  `service_nums` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '服务人员数量',
  `already_service_nums` int(10) NOT NULL DEFAULT '0' COMMENT '已拥有人员数量',
  `name` varchar(40) NOT NULL COMMENT '商家名称',
  `abbr` char(20) NOT NULL COMMENT '商户缩写',
  `type` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '类型:0=企业,1=个体工商户',
  `code` int(10) NOT NULL COMMENT '商家码',
  `percent` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '订单分成',
  `credit_code` varchar(30) NOT NULL COMMENT '统一社会信用代码',
  `license_image` varchar(122) NOT NULL COMMENT '营业执照',
  `username` char(20) NOT NULL COMMENT '法人姓名',
  `mobile` char(20) NOT NULL COMMENT '法人手机号',
  `idcard` char(20) NOT NULL COMMENT '身份证号',
  `front_image` varchar(122) NOT NULL COMMENT '身份证正面',
  `opposite_image` varchar(122) NOT NULL COMMENT '身份证反面',
  `intro` varchar(122) NOT NULL COMMENT '商家简介',
  `logo_image` varchar(122) NOT NULL COMMENT 'logo',
  `category_ids` varchar(122) NOT NULL COMMENT '经营分类',
  `goods_ids` varchar(500) NOT NULL COMMENT '服务项目',
  `leader_name` char(20) NOT NULL COMMENT '负责人姓名',
  `leader_mobile` char(20) NOT NULL COMMENT '负责人手机号',
  `withdrawtype` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '提现方式:0=月,1=周',
  `day` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '具体提现日期',
  `settle_day` int(5) unsigned NOT NULL DEFAULT '1' COMMENT '订单结算日期',
  `trade_hour` varchar(122) DEFAULT NULL COMMENT '营业时间',
  `province` varchar(30) NOT NULL COMMENT '省',
  `city` varchar(30) NOT NULL COMMENT '市',
  `district` varchar(50) DEFAULT NULL COMMENT '县',
  `address` varchar(122) NOT NULL COMMENT '详细地址',
  `lng` char(20) NOT NULL COMMENT '经度',
  `lat` char(20) NOT NULL COMMENT '纬度',
  `is_train` tinyint(1) NOT NULL DEFAULT '0' COMMENT '岗前培训:0=未培训,1=已培训',
  `rebate_price` float(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '总佣金收入',
  `salenums` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '服务数量',
  `weigh` int(10) NOT NULL DEFAULT '0' COMMENT '权重',
  `state` enum('0','1') NOT NULL DEFAULT '1' COMMENT '状态:0=隐藏,1=显示',
  `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  `updatetime` bigint(16) DEFAULT NULL COMMENT '更新时间',
  `deletetime` bigint(16) DEFAULT NULL COMMENT '删除时间',
  PRIMARY KEY (`id`),
  KEY `name` (`name`),
  KEY `weigh` (`weigh`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COMMENT='商家表';
CREATE TABLE IF NOT EXISTS `__PREFIX__service_shop_ensure` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  `name` char(20) NOT NULL COMMENT '名称',
  `price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '保证金金额',
  `accept_nums` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '日接单数量',
  `service_nums` int(10) NOT NULL DEFAULT '0' COMMENT '服务人员数量',
  `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  `updatetime` bigint(16) DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COMMENT='商家服务金';
CREATE TABLE IF NOT EXISTS `__PREFIX__service_shop_ensure_pay` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  `user_id` int(10) unsigned NOT NULL COMMENT '用户id',
  `price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '支付金额',
  `orderId` varchar(40) DEFAULT NULL COMMENT '订单编号',
  `trade_no` varchar(30) DEFAULT NULL COMMENT '交易单号',
  `paytype` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '支付类型:0=微信小程序,1=微信APP,2=公众号支付,3=支付宝支付',
  `state` tinyint(1) NOT NULL DEFAULT '0' COMMENT '状态:0=待支付,1=支付成功',
  `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  `paytime` bigint(16) DEFAULT NULL COMMENT '支付时间',
  `updatetime` bigint(16) DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`),
  UNIQUE KEY `user_id` (`user_id`,`createtime`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COMMENT='商家保证金支付表';
CREATE TABLE IF NOT EXISTS `__PREFIX__service_shop_money_log` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  `user_id` int(10) unsigned NOT NULL COMMENT '用户id',
  `money` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '变更余额',
  `order_id` int(10) DEFAULT NULL COMMENT '订单id',
  `memo` varchar(255) NOT NULL COMMENT '备注',
  `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COMMENT='服务者商户余额记录';
CREATE TABLE IF NOT EXISTS `__PREFIX__service_shop_user_money_log` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  `user_id` int(10) unsigned NOT NULL COMMENT '用户id',
  `money` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '变更金额	',
  `order_id` int(10) DEFAULT NULL COMMENT '订单id',
  `memo` varchar(255) NOT NULL COMMENT '备注',
  `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COMMENT='商户平台余额记录';
CREATE TABLE IF NOT EXISTS `__PREFIX__service_skill` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  `user_id` int(10) unsigned NOT NULL COMMENT '用户id',
  `shop_id` int(10) DEFAULT NULL COMMENT '商家id',
  `code` char(20) DEFAULT NULL COMMENT '服务工号',
  `mobile` char(20) NOT NULL COMMENT '手机号',
  `ensure_id` int(10) DEFAULT NULL COMMENT '保证金id',
  `ensure_price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '保证金',
  `ensure_name` varchar(30) DEFAULT NULL COMMENT '保证金等级名称',
  `accept_nums` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '每日可接单数量',
  `already_accept_nums` int(10) NOT NULL DEFAULT '0' COMMENT '已接取数量',
  `credit_score` tinyint(1) unsigned NOT NULL DEFAULT '60' COMMENT '信用分',
  `percent` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '订单分成%',
  `name` char(20) NOT NULL COMMENT '姓名',
  `sex` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '性别:1=男,0=女',
  `idcard` char(20) NOT NULL COMMENT '身份证号',
  `front_image` varchar(122) NOT NULL COMMENT '身份证正面',
  `opposite_image` varchar(122) NOT NULL COMMENT '身份证反面',
  `user_image` varchar(122) NOT NULL COMMENT '实拍照',
  `certificate_image` varchar(122) NOT NULL COMMENT '从业资格证',
  `health_image` varchar(122) NOT NULL COMMENT '健康证',
  `category_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '项目分类id',
  `skill_cate_id` int(10) unsigned NOT NULL COMMENT '职业技能分类id',
  `goods_ids` varchar(500) NOT NULL COMMENT '服务项目',
  `image` varchar(122) NOT NULL COMMENT '工装照',
  `images` varchar(1500) DEFAULT NULL COMMENT '生活照',
  `edu` tinyint(1) unsigned NOT NULL COMMENT '学历:0=小学文化,1=初中,2=高中,3=大专,4=本科,5=硕士,6=博士',
  `age` tinyint(1) unsigned NOT NULL COMMENT '年龄',
  `nation` char(20) NOT NULL COMMENT '民族',
  `height` tinyint(1) DEFAULT NULL COMMENT '身高/cm',
  `weight` tinyint(1) DEFAULT NULL COMMENT '体重/kg',
  `exper` tinyint(1) NOT NULL DEFAULT '0' COMMENT '经验:0=1年以下,1=1-3年,2=3-5年,3=5年以上',
  `province` varchar(30) NOT NULL COMMENT '省',
  `city` varchar(30) NOT NULL COMMENT '市',
  `district` varchar(30) DEFAULT NULL COMMENT '县',
  `address` varchar(122) NOT NULL COMMENT '详细地址',
  `lng` char(20) NOT NULL COMMENT '经度',
  `lat` char(20) NOT NULL COMMENT '纬度',
  `is_rest` tinyint(1) NOT NULL DEFAULT '0' COMMENT '工作状态:0=接单中,1=休息中',
  `is_train` tinyint(1) NOT NULL DEFAULT '0' COMMENT '岗前培训:0=未培训,1=已培训',
  `rebate_price` float(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '总佣金收入',
  `salenums` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '服务数量',
  `state` enum('0','1') NOT NULL DEFAULT '1' COMMENT '状态:0=隐藏,1=显示',
  `weigh` int(10) NOT NULL DEFAULT '0' COMMENT '权重',
  `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  `updatetime` bigint(16) DEFAULT NULL COMMENT '更新时间',
  `deletetime` bigint(16) DEFAULT NULL COMMENT '删除时间',
  PRIMARY KEY (`id`),
  KEY `name` (`name`),
  KEY `shop_id` (`shop_id`),
  KEY `weigh` (`weigh`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COMMENT='服务人员信息表';
CREATE TABLE IF NOT EXISTS `__PREFIX__service_skill_cate` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  `name` varchar(30) NOT NULL COMMENT '分类名称',
  `state` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '状态:0=隐藏,1=显示',
  `createtime` int(16) DEFAULT NULL COMMENT '创建时间',
  `updatetime` int(16) DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COMMENT='技师分类表';
CREATE TABLE IF NOT EXISTS `__PREFIX__service_skill_ensure` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  `name` char(20) NOT NULL COMMENT '名称',
  `price` decimal(8,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '保证金金额',
  `accept_nums` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '日接单数量',
  `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  `updatetime` bigint(16) DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COMMENT='商户保证金';
CREATE TABLE IF NOT EXISTS `__PREFIX__service_skill_ensure_pay` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  `user_id` int(10) unsigned NOT NULL COMMENT '服务者用户id',
  `price` decimal(8,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '支付金额',
  `orderId` varchar(40) NOT NULL COMMENT '订单编号',
  `trade_no` varchar(30) DEFAULT NULL COMMENT '交易单号',
  `paytype` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '支付类型:0=微信小程序,1=微信APP,2=公众号支付,3=支付宝支付',
  `state` tinyint(1) NOT NULL DEFAULT '0' COMMENT '状态:0=待支付,1=支付成功',
  `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  `paytime` bigint(16) DEFAULT NULL COMMENT '支付时间',
  `updatetime` bigint(16) DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`),
  UNIQUE KEY `user_id` (`user_id`,`createtime`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='服务者保证金支付';
CREATE TABLE IF NOT EXISTS `__PREFIX__service_skill_time` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  `skill_id` int(10) unsigned NOT NULL COMMENT '服务人员id',
  `buy_id` int(10) DEFAULT NULL COMMENT '下单用户id',
  `timetype` tinyint(1) NOT NULL DEFAULT '0' COMMENT '时间类型:0=今天,1=明天,2=后天',
  `number` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '时间序号',
  `starttime` bigint(16) NOT NULL COMMENT '创建时间',
  `endtime` bigint(16) NOT NULL COMMENT '更新时间',
  `state` tinyint(1) NOT NULL DEFAULT '0' COMMENT '状态:0=空闲,1=已预约,2=不可预约	',
  `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  `updatetime` bigint(16) DEFAULT NULL COMMENT '更新时间',
  `changetime` bigint(16) DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`),
  KEY `skill_id` (`skill_id`)
) ENGINE=InnoDB AUTO_INCREMENT=577 DEFAULT CHARSET=utf8mb4 COMMENT='技师时间表';
CREATE TABLE IF NOT EXISTS `__PREFIX__service_thumb` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  `image` varchar(122) NOT NULL COMMENT '图片',
  `type` tinyint(1) NOT NULL DEFAULT '0' COMMENT '跳转类型:0=不跳转,1=项目详情,2=文本协议,3=其他路由',
  `goods_id` int(10) DEFAULT NULL COMMENT '项目id',
  `config_text_id` int(10) DEFAULT NULL COMMENT '文本协议id',
  `jump_id` int(10) DEFAULT NULL COMMENT '路由链接',
  `state` tinyint(1) NOT NULL DEFAULT '1' COMMENT '状态:0=隐藏,1=显示',
  `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  `updatetime` bigint(16) DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COMMENT='轮播图表';
CREATE TABLE IF NOT EXISTS `__PREFIX__service_total_data` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  `total_order_nums` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '总订单',
  `total_user_nums` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '总用户',
  `total_plus_nums` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '总会员',
  `total_skill_nums` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '总服务人员',
  `total_shop_nums` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '总商户',
  `total_price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '总金额',
  `rebate_price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '总佣金',
  `recharge_price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '总充值',
  `withdraw_price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '提现总额',
  `skill_ensure_price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '服务人员保证金',
  `shop_ensure_price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '商户保证金',
  `day_order_nums` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '日服务订单数量',
  `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  `updatetime` bigint(16) DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8mb4 COMMENT='数据统计表';
CREATE TABLE IF NOT EXISTS `__PREFIX__service_train` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  `title` varchar(60) NOT NULL COMMENT '标题',
  `type` tinyint(1) NOT NULL DEFAULT '0' COMMENT '类型:0=服务端,1=商户端',
  `image` varchar(122) NOT NULL COMMENT '封面图',
  `videofile` varchar(122) NOT NULL COMMENT '视频',
  `state` tinyint(1) NOT NULL DEFAULT '1' COMMENT '状态:0=隐藏,1=显示',
  `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  `updatetime` bigint(16) DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='培训表';
CREATE TABLE IF NOT EXISTS `__PREFIX__service_user_coupon` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  `user_id` int(10) unsigned NOT NULL COMMENT '用户id',
  `coupon_id` int(10) unsigned NOT NULL COMMENT '优惠券id',
  `type` tinyint(1) NOT NULL DEFAULT '0' COMMENT '优惠券类型:0=平台通用券,1=平台项目券,2=商户通用券,3=商户项目券,4=口令券',
  `goods_id` int(10) DEFAULT NULL COMMENT '项目id',
  `shop_id` int(10) DEFAULT NULL COMMENT '商户id',
  `code` char(20) DEFAULT NULL COMMENT '口令',
  `achieve` int(10) unsigned NOT NULL COMMENT '满',
  `reduce` int(10) unsigned NOT NULL COMMENT '减',
  `exittime` bigint(16) unsigned NOT NULL COMMENT '截止时间',
  `state` tinyint(1) NOT NULL DEFAULT '0' COMMENT '状态:0=待使用,1=已使用,-1=已过期	',
  `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  `updatetime` bigint(16) DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8mb4 COMMENT='用户优惠券表';
CREATE TABLE IF NOT EXISTS `__PREFIX__service_user_info` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  `user_id` int(10) unsigned NOT NULL COMMENT '用户id',
  `mobile` char(20) NOT NULL COMMENT '手机号',
  `is_skill` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '是否服务人员:0=否,1=是',
  `is_shop` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '是否商家:0=否,1=是',
  `leader_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '上级用户id',
  `rec_leader_id` int(10) DEFAULT '0' COMMENT '上上级用户id',
  `total_price` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '消费总额',
  `unionid` varchar(40) DEFAULT NULL COMMENT '联合id',
  `user_openid` varchar(40) DEFAULT NULL COMMENT '用户openid',
  `skill_openid` varchar(40) DEFAULT NULL COMMENT '服务openid',
  `shop_openid` varchar(40) DEFAULT NULL COMMENT '商家openid',
  `alipay_name` char(20) DEFAULT NULL COMMENT '支付宝姓名',
  `alipay_account` varchar(30) DEFAULT NULL COMMENT '支付宝账号',
  `bank_name` varchar(122) DEFAULT NULL COMMENT '开户行',
  `bank_user` char(20) DEFAULT NULL COMMENT '开户人',
  `bank_card` char(20) DEFAULT NULL COMMENT '银行卡号',
  `money` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '服务者平台可提现余额',
  `shop_money` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '商户可提现余额',
  `shop_user_money` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '商户平台可提现余额',
  `rebate_money` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '佣金',
  `is_plus` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '会员:0=否,1=是',
  `is_update` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否更新:0=否,1=是',
  `discount` tinyint(1) unsigned NOT NULL DEFAULT '100' COMMENT '享受折扣%',
  `plusname` varchar(30) DEFAULT NULL COMMENT '会员名称',
  `plustime` bigint(16) DEFAULT NULL COMMENT '会员有效期',
  `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  `updatetime` bigint(16) DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`),
  KEY `user_id` (`user_id`),
  KEY `mobile` (`mobile`),
  KEY `is_skill` (`is_skill`),
  KEY `is_shop` (`is_shop`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COMMENT='用户信息表';
CREATE TABLE IF NOT EXISTS `__PREFIX__service_user_money_log` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  `user_id` int(10) unsigned NOT NULL COMMENT '用户id',
  `money` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '变更金额',
  `order_id` int(10) DEFAULT NULL COMMENT '订单id',
  `memo` varchar(255) NOT NULL COMMENT '备注',
  `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='服务者平台余额明细表';
CREATE TABLE IF NOT EXISTS `__PREFIX__service_withdraw` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
  `user_id` int(10) unsigned NOT NULL COMMENT '提现用户id',
  `type` tinyint(1) unsigned DEFAULT '0' COMMENT '金额来源:0=服务者平台余额提现,1=服务者商户余额提现,2=商户平台余额提现,3=服务者保证金提现,4=商户保证金提现',
  `shop_id` int(10) DEFAULT NULL COMMENT '商户id',
  `withdrawtype` tinyint(1) NOT NULL DEFAULT '0' COMMENT '提现方式:0=支付宝,1=银行卡',
  `withdraw_info` varchar(255) NOT NULL COMMENT '提现信息',
  `num` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '提现金额',
  `images` varchar(1000) DEFAULT NULL COMMENT '转账证明',
  `state` tinyint(1) NOT NULL DEFAULT '0' COMMENT '提现状态:-1=已拒绝,0=待审核,1=已审核,2=已转账',
  `note` varchar(100) DEFAULT NULL COMMENT '拒绝原因',
  `createtime` bigint(16) DEFAULT NULL COMMENT '创建时间',
  `updatetime` bigint(16) DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`),
  UNIQUE KEY `user_id` (`user_id`,`createtime`),
  KEY `shop_id` (`shop_id`),
  KEY `user_index` (`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COMMENT='提现';
--
-- 1.0.1
-- 添加名称字段name
--
ALTER TABLE `__PREFIX__service_recharge` ADD COLUMN `gift_price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '赠送金额' AFTER `price`;
ALTER TABLE `__PREFIX__service_recharge` ADD COLUMN `recharge_package_id` INT(10) unsigned NOT NULL DEFAULT 0 COMMENT '充值套餐id' AFTER `user_id`;
--
-- 1.1.0
-- 添加名称字段name
--
ALTER TABLE `__PREFIX__service_order` 
  ADD COLUMN leader_id INT(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '上级用户id',
  ADD COLUMN rec_leader_id INT(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '上上级用户id'
  ADD COLUMN ordertype TINYINT(1) NOT NULL DEFAULT 0 COMMENT '订单类型:0=普通订单,1=套餐订单',
  ADD COLUMN package_order_id INT(10) DEFAULT NULL COMMENT '套餐卡订单id';
ALTER TABLE `__PREFIX__service_user_info` 
  ADD COLUMN leader_id INT(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '上级用户id',
  ADD COLUMN rec_leader_id INT(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '上上级用户id';
ALTER TABLE `__PREFIX__service_goods_sku`
  ADD COLUMN type TINYINT(1) NOT NULL DEFAULT 0 COMMENT '项目类型:0=普通项目,1=可入套餐项目';
--
-- 1.1.1
-- 添加名称字段name
--    
ALTER TABLE `__PREFIX__service_order` 
  ADD COLUMN skill_price decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '服务者佣金',
  ADD COLUMN shop_price decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '门店佣金',
  ADD COLUMN platform_price decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '平台收益',
  ADD COLUMN leader_price decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '直推分佣',
  ADD COLUMN rec_leader_price decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '间推分佣',
  ADD COLUMN dis_price decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '分销金额';
ALTER TABLE `__PREFIX__service_user_info` 
  ADD COLUMN total_price decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '消费总额';
  ADD COLUMN rebate_money decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '佣金';
ALTER TABLE `__PREFIX__service_goods`
  ADD COLUMN `cost_seconds` int(10) unsigned NOT NULL COMMENT '时长/分钟'; 
