/*
Navicat MySQL Data Transfer

Source Server         : 本地开发
Source Server Version : 50731
Source Host           : localhost:3306
Source Database       : wechat

Target Server Type    : MYSQL
Target Server Version : 50731
File Encoding         : 65001

Date: 2020-12-18 10:28:52
*/

SET FOREIGN_KEY_CHECKS=0;

-- ----------------------------
-- Table structure for ai_allwin_adwords
-- ----------------------------
DROP TABLE IF EXISTS `ai_allwin_adwords`;
CREATE TABLE `ai_allwin_adwords` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `member_miniapp_id` int(11) DEFAULT '0',
  `open_type` varchar(50) DEFAULT NULL,
  `group` varchar(100) DEFAULT NULL,
  `title` varchar(50) DEFAULT NULL,
  `link` varchar(200) DEFAULT NULL,
  `picture` varchar(255) DEFAULT NULL,
  `sort` int(11) DEFAULT '0',
  `update_time` int(11) DEFAULT NULL,
  `create_time` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Table structure for ai_allwin_bank
-- ----------------------------
DROP TABLE IF EXISTS `ai_allwin_bank`;
CREATE TABLE `ai_allwin_bank` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `member_miniapp_id` int(11) DEFAULT NULL,
  `user_id` bigint(20) DEFAULT NULL,
  `money` bigint(20) DEFAULT '0' COMMENT '帐号余额',
  `lack_money` bigint(20) DEFAULT '0' COMMENT '锁定金额',
  `due_money` bigint(20) DEFAULT '0' COMMENT '应付款',
  `shop_money` bigint(20) DEFAULT '0' COMMENT '购物积分',
  `income_money` bigint(20) DEFAULT '0' COMMENT '累计收益',
  `save_money` bigint(20) DEFAULT NULL,
  `update_time` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Table structure for ai_allwin_bank_bill
-- ----------------------------
DROP TABLE IF EXISTS `ai_allwin_bank_bill`;
CREATE TABLE `ai_allwin_bank_bill` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `member_miniapp_id` int(11) DEFAULT NULL,
  `store_id` int(11) DEFAULT '0',
  `user_id` bigint(20) DEFAULT '0',
  `pay_uid` bigint(20) DEFAULT '0',
  `money` decimal(10,2) DEFAULT '0.00',
  `message` tinytext,
  `update_time` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `id` (`id`),
  KEY `id_2` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='个人财务记录';

-- ----------------------------
-- Table structure for ai_allwin_bank_cash
-- ----------------------------
DROP TABLE IF EXISTS `ai_allwin_bank_cash`;
CREATE TABLE `ai_allwin_bank_cash` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `member_miniapp_id` int(11) DEFAULT NULL,
  `user_id` bigint(20) DEFAULT NULL,
  `money` decimal(10,2) DEFAULT '0.00' COMMENT '申请金额',
  `realmoney` decimal(10,2) DEFAULT '0.00' COMMENT '实际到账',
  `update_time` int(11) DEFAULT NULL,
  `state` tinyint(1) DEFAULT '0' COMMENT '0新申请1通过-1不通过',
  `audit_time` int(11) DEFAULT NULL,
  `trade_no` varchar(100) DEFAULT NULL,
  `msg` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='提现申请列表';

-- ----------------------------
-- Table structure for ai_allwin_bank_recharge
-- ----------------------------
DROP TABLE IF EXISTS `ai_allwin_bank_recharge`;
CREATE TABLE `ai_allwin_bank_recharge` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `member_miniapp_id` int(11) DEFAULT NULL,
  `user_id` int(11) DEFAULT NULL,
  `money` decimal(10,2) DEFAULT NULL,
  `state` tinyint(1) DEFAULT '0',
  `order_no` varchar(255) DEFAULT NULL,
  `update_time` int(11) DEFAULT NULL,
  `paid_time` int(11) DEFAULT NULL,
  `paid_no` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Table structure for ai_allwin_card
-- ----------------------------
DROP TABLE IF EXISTS `ai_allwin_card`;
CREATE TABLE `ai_allwin_card` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `is_lock` tinyint(1) DEFAULT '0',
  `member_miniapp_id` int(11) DEFAULT NULL,
  `coupon_num` int(11) DEFAULT '0',
  `store_id` int(11) DEFAULT NULL,
  `name` varchar(255) DEFAULT NULL,
  `price` decimal(11,2) DEFAULT NULL,
  `tips` text,
  `coupon_id` bigint(20) DEFAULT NULL,
  `coupon_ids` text,
  `locktime` int(11) DEFAULT NULL,
  `create_time` int(11) DEFAULT NULL,
  `update_time` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Table structure for ai_allwin_card_user
-- ----------------------------
DROP TABLE IF EXISTS `ai_allwin_card_user`;
CREATE TABLE `ai_allwin_card_user` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `member_miniapp_id` int(11) DEFAULT NULL,
  `user_coupon_id` bigint(11) DEFAULT '0',
  `store_id` int(11) DEFAULT NULL,
  `card_id` int(11) DEFAULT NULL,
  `user_id` bigint(11) DEFAULT NULL,
  `amount` decimal(11,2) DEFAULT NULL,
  `create_time` int(11) DEFAULT NULL,
  `update_time` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `UID` (`user_id`) USING BTREE,
  KEY `APIID` (`member_miniapp_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Table structure for ai_allwin_card_user_order
-- ----------------------------
DROP TABLE IF EXISTS `ai_allwin_card_user_order`;
CREATE TABLE `ai_allwin_card_user_order` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `member_miniapp_id` int(11) DEFAULT NULL,
  `store_id` int(11) DEFAULT NULL,
  `user_id` bigint(11) DEFAULT NULL,
  `card_id` int(11) DEFAULT NULL,
  `coupon_id` bigint(11) DEFAULT NULL,
  `user_card_id` int(11) DEFAULT NULL,
  `coupon_ids` varchar(255) DEFAULT NULL COMMENT '赠品列表',
  `state` tinyint(1) DEFAULT '0',
  `amount` decimal(10,2) DEFAULT NULL,
  `order_no` varchar(255) DEFAULT NULL,
  `paid_time` int(11) DEFAULT NULL,
  `create_time` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `UID` (`user_id`),
  KEY `APIID` (`member_miniapp_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Table structure for ai_allwin_config
-- ----------------------------
DROP TABLE IF EXISTS `ai_allwin_config`;
CREATE TABLE `ai_allwin_config` (
  `member_miniapp_id` int(11) NOT NULL,
  `service_telephone` varchar(100) DEFAULT NULL,
  `default_charges` tinyint(4) DEFAULT '0',
  `cash_charges` tinyint(4) DEFAULT '0',
  `agent_rebate` tinyint(4) DEFAULT '0' COMMENT '代理',
  `store_rebate` tinyint(4) DEFAULT '0' COMMENT '好店',
  `company_rebate` tinyint(4) DEFAULT '0' COMMENT '分公司',
  `workers_rebate` tinyint(4) DEFAULT '0' COMMENT '分公司员工',
  `workers_on_amount` decimal(10,2) DEFAULT NULL,
  `is_dopay_on_vip` tinyint(1) DEFAULT '0' COMMENT '买单开通拓客',
  `is_fees_types` tinyint(1) DEFAULT '0' COMMENT '买单收费模式',
  `is_psp` tinyint(1) DEFAULT NULL,
  `is_wechat_profitsharing` tinyint(1) DEFAULT '0' COMMENT '是否微信分账',
  `is_wechat_touser` tinyint(1) DEFAULT NULL,
  `is_wechat_redpacket` tinyint(1) DEFAULT NULL,
  `tplmsg_order` varchar(100) DEFAULT NULL COMMENT '支付成功通知',
  `tplmsg_point` varchar(100) DEFAULT NULL COMMENT '积分兑换通知',
  `workers_on_store` decimal(10,2) DEFAULT NULL,
  `workers_discount` decimal(10,2) DEFAULT NULL,
  `sla` text,
  `agent_on_amount` decimal(10,2) DEFAULT NULL,
  `article` text,
  PRIMARY KEY (`member_miniapp_id`),
  UNIQUE KEY `APPID` (`member_miniapp_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Table structure for ai_allwin_coupon
-- ----------------------------
DROP TABLE IF EXISTS `ai_allwin_coupon`;
CREATE TABLE `ai_allwin_coupon` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `member_miniapp_id` int(11) DEFAULT NULL,
  `store_id` int(11) DEFAULT NULL,
  `cate_sid` int(11) DEFAULT NULL,
  `is_top` tinyint(1) DEFAULT NULL,
  `is_lock` tinyint(1) DEFAULT '0',
  `is_platform` tinyint(1) DEFAULT '0' COMMENT '是否平台卷1是',
  `is_check` tinyint(1) DEFAULT '0',
  `is_shop` tinyint(1) DEFAULT '0',
  `is_vip` tinyint(1) DEFAULT '0',
  `is_end` tinyint(1) DEFAULT '0' COMMENT '是否过期失效',
  `cate_id` int(11) DEFAULT NULL,
  `longtime` int(10) DEFAULT '0' COMMENT '使用间隔',
  `daynum` int(11) DEFAULT '1' COMMENT '每次几次',
  `ontypes` tinyint(1) DEFAULT '0' COMMENT '生效方式[0立即生效]',
  `types` tinyint(1) DEFAULT '0' COMMENT '0满减1打折卷',
  `num` int(10) DEFAULT NULL COMMENT '发现总量',
  `num_of` int(10) DEFAULT '1',
  `theme` varchar(20) DEFAULT NULL,
  `img` varchar(255) DEFAULT NULL,
  `name` varchar(255) DEFAULT NULL,
  `size` decimal(10,2) DEFAULT NULL,
  `pay_price` decimal(10,2) DEFAULT '2.00' COMMENT '元',
  `shop_price` decimal(10,2) DEFAULT NULL,
  `price` decimal(10,2) DEFAULT NULL COMMENT '分',
  `discount` int(5) DEFAULT '0',
  `weekday` varchar(100) DEFAULT NULL,
  `howmuch` int(10) DEFAULT NULL COMMENT '分',
  `starttime` int(11) DEFAULT NULL,
  `endtime` int(11) DEFAULT NULL,
  `tips` varchar(255) DEFAULT NULL,
  `sort` int(11) DEFAULT '0',
  `update_time` int(11) DEFAULT NULL,
  `create_time` int(11) DEFAULT NULL COMMENT '0',
  PRIMARY KEY (`id`),
  KEY `APPID` (`member_miniapp_id`),
  KEY `STOREID` (`store_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Table structure for ai_allwin_coupon_log
-- ----------------------------
DROP TABLE IF EXISTS `ai_allwin_coupon_log`;
CREATE TABLE `ai_allwin_coupon_log` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `member_miniapp_id` int(11) DEFAULT NULL,
  `uid` bigint(20) DEFAULT NULL,
  `coupon_id` int(11) DEFAULT NULL,
  `amount` decimal(10,2) DEFAULT NULL,
  `times` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='赠品使用日志';

-- ----------------------------
-- Table structure for ai_allwin_coupon_order
-- ----------------------------
DROP TABLE IF EXISTS `ai_allwin_coupon_order`;
CREATE TABLE `ai_allwin_coupon_order` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `member_miniapp_id` int(11) DEFAULT NULL,
  `user_id` int(11) DEFAULT NULL,
  `store_id` int(11) DEFAULT NULL,
  `coupon_ids` varchar(255) DEFAULT NULL,
  `order_no` varchar(255) DEFAULT NULL,
  `amount` decimal(10,2) DEFAULT NULL,
  `state` tinyint(1) DEFAULT '0',
  `paid_time` int(11) DEFAULT NULL,
  `paid_no` varchar(255) DEFAULT NULL,
  `update_time` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='赠品购买订单';

-- ----------------------------
-- Table structure for ai_allwin_coupon_subsidize
-- ----------------------------
DROP TABLE IF EXISTS `ai_allwin_coupon_subsidize`;
CREATE TABLE `ai_allwin_coupon_subsidize` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `member_miniapp_id` int(11) DEFAULT NULL,
  `coupon_id` int(11) NOT NULL COMMENT '赠品ID',
  `how_much` decimal(10,2) DEFAULT NULL COMMENT '补贴金额',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='平台补贴的赠品';

-- ----------------------------
-- Table structure for ai_allwin_coupon_user
-- ----------------------------
DROP TABLE IF EXISTS `ai_allwin_coupon_user`;
CREATE TABLE `ai_allwin_coupon_user` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `member_miniapp_id` int(11) DEFAULT NULL,
  `store_id` int(11) DEFAULT NULL,
  `coupon_id` int(11) DEFAULT NULL,
  `uid` bigint(20) DEFAULT NULL,
  `is_end` tinyint(1) DEFAULT '0',
  `longtime` int(10) DEFAULT NULL COMMENT '使用间隔',
  `daynum` int(11) DEFAULT '1' COMMENT '每次几次',
  `ontypes` tinyint(1) DEFAULT '0' COMMENT '生效方式[0立即生效]',
  `types` tinyint(4) DEFAULT '0' COMMENT '0满减1打折卷',
  `starttime` int(11) DEFAULT NULL,
  `endtime` int(11) DEFAULT NULL,
  `name` varchar(255) DEFAULT NULL,
  `size` decimal(10,2) DEFAULT NULL,
  `user_size` decimal(10,2) DEFAULT '0.00',
  `price` decimal(10,2) DEFAULT NULL COMMENT '分',
  `discount` int(5) DEFAULT NULL,
  `weekday` varchar(100) DEFAULT NULL,
  `howmuch` int(10) DEFAULT NULL COMMENT '元',
  `tips` varchar(255) DEFAULT NULL,
  `update_time` int(11) DEFAULT NULL,
  `create_time` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `APPID` (`member_miniapp_id`),
  KEY `STOREID` (`store_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='用户的赠品';

-- ----------------------------
-- Table structure for ai_allwin_ecard
-- ----------------------------
DROP TABLE IF EXISTS `ai_allwin_ecard`;
CREATE TABLE `ai_allwin_ecard` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `member_miniapp_id` int(11) DEFAULT NULL,
  `brand_name` varchar(255) DEFAULT NULL,
  `title` varchar(255) DEFAULT NULL,
  `notice` varchar(255) DEFAULT NULL,
  `description` varchar(255) DEFAULT NULL,
  `prerogative` varchar(255) DEFAULT NULL,
  `quantity` int(11) DEFAULT NULL,
  `color` varchar(50) DEFAULT NULL,
  `picture` varchar(100) DEFAULT NULL,
  `card_id` varchar(255) DEFAULT NULL,
  `start_time` int(11) DEFAULT NULL,
  `end_time` int(11) DEFAULT NULL,
  `gh_id` varchar(255) DEFAULT NULL,
  `annual_fee` decimal(10,2) DEFAULT NULL,
  `ids` varchar(255) DEFAULT NULL,
  `create_time` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `ID` (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='分类信息栏目';

-- ----------------------------
-- Table structure for ai_allwin_ecard_order
-- ----------------------------
DROP TABLE IF EXISTS `ai_allwin_ecard_order`;
CREATE TABLE `ai_allwin_ecard_order` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `member_miniapp_id` int(11) DEFAULT NULL,
  `card_id` varchar(255) DEFAULT NULL,
  `uid` int(11) DEFAULT NULL,
  `order_no` varchar(50) DEFAULT NULL,
  `status` tinyint(2) DEFAULT '0',
  `create_time` int(11) DEFAULT NULL,
  `amount` decimal(10,2) DEFAULT NULL,
  `paid_at` tinyint(1) DEFAULT '0',
  `paid_time` int(11) DEFAULT NULL,
  `paid_no` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `ID` (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='分类信息栏目';

-- ----------------------------
-- Table structure for ai_allwin_ecard_user
-- ----------------------------
DROP TABLE IF EXISTS `ai_allwin_ecard_user`;
CREATE TABLE `ai_allwin_ecard_user` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `member_miniapp_id` int(11) DEFAULT NULL,
  `card_id` varchar(255) DEFAULT NULL,
  `code` varchar(255) DEFAULT NULL,
  `uid` int(11) DEFAULT NULL,
  `outer_str` varchar(255) DEFAULT NULL,
  `is_del` tinyint(2) DEFAULT '0',
  `create_time` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `ID` (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='分类信息栏目';

-- ----------------------------
-- Table structure for ai_allwin_fund
-- ----------------------------
DROP TABLE IF EXISTS `ai_allwin_fund`;
CREATE TABLE `ai_allwin_fund` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `member_miniapp_id` int(11) DEFAULT NULL,
  `balance` decimal(10,2) DEFAULT NULL,
  `subsidize` decimal(10,2) DEFAULT NULL,
  `subsidize_num` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='采购基金';

-- ----------------------------
-- Table structure for ai_allwin_fund_bill
-- ----------------------------
DROP TABLE IF EXISTS `ai_allwin_fund_bill`;
CREATE TABLE `ai_allwin_fund_bill` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `member_miniapp_id` int(11) DEFAULT NULL,
  `store_id` int(11) DEFAULT NULL,
  `uid` int(11) DEFAULT NULL,
  `types` tinyint(13) DEFAULT NULL COMMENT '0入1出',
  `money` decimal(10,2) DEFAULT NULL,
  `order_no` varchar(100) DEFAULT NULL,
  `update_time` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='基金账单';

-- ----------------------------
-- Table structure for ai_allwin_gift
-- ----------------------------
DROP TABLE IF EXISTS `ai_allwin_gift`;
CREATE TABLE `ai_allwin_gift` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `member_miniapp_id` int(11) DEFAULT NULL,
  `types` varchar(255) DEFAULT '0',
  `pay_num` int(11) DEFAULT '0',
  `pay_amount` varchar(255) DEFAULT '0',
  `coupon_id` int(11) DEFAULT '0',
  `title` varchar(255) DEFAULT NULL,
  `share_img` varchar(255) DEFAULT NULL,
  `share_title` varchar(50) DEFAULT NULL,
  `share_text` varchar(100) DEFAULT NULL,
  `note` text,
  `start_time` int(11) DEFAULT NULL,
  `end_time` int(11) DEFAULT NULL,
  `views` int(11) DEFAULT '0',
  `is_lock` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='支付有礼';

-- ----------------------------
-- Table structure for ai_allwin_gift_data
-- ----------------------------
DROP TABLE IF EXISTS `ai_allwin_gift_data`;
CREATE TABLE `ai_allwin_gift_data` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `uid` int(11) DEFAULT NULL,
  `gift_id` int(11) DEFAULT NULL,
  `pay_num` int(11) DEFAULT '0',
  `pay_amount` decimal(10,2) DEFAULT '0.00',
  `coupon_id` int(11) DEFAULT '0',
  `update_time` int(11) DEFAULT NULL COMMENT '获增时间',
  `is_take` tinyint(1) DEFAULT '0',
  `take_time` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `GIFTID` (`gift_id`),
  KEY `UID` (`uid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='支付有礼';

-- ----------------------------
-- Table structure for ai_allwin_gift_store
-- ----------------------------
DROP TABLE IF EXISTS `ai_allwin_gift_store`;
CREATE TABLE `ai_allwin_gift_store` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `member_miniapp_id` int(11) DEFAULT NULL,
  `is_lock` tinyint(1) DEFAULT '0',
  `gift_id` int(11) DEFAULT NULL,
  `store_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `STOREID` (`is_lock`,`gift_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='支付有礼';

-- ----------------------------
-- Table structure for ai_allwin_info
-- ----------------------------
DROP TABLE IF EXISTS `ai_allwin_info`;
CREATE TABLE `ai_allwin_info` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `cate_id` int(11) DEFAULT NULL,
  `store_id` int(11) DEFAULT '0',
  `user_id` bigint(20) DEFAULT NULL,
  `member_miniapp_id` int(11) DEFAULT NULL,
  `themes` text,
  `fields` text,
  `telphone` varchar(255) DEFAULT NULL,
  `url_slogan` varchar(255) DEFAULT NULL,
  `links` varchar(255) DEFAULT NULL,
  `is_get` tinyint(2) DEFAULT '0' COMMENT '是否获取用户信息',
  `price` decimal(10,2) DEFAULT '0.00' COMMENT '获取用户价格',
  `video` varchar(255) DEFAULT NULL,
  `images` text,
  `is_top` int(11) DEFAULT '0',
  `topday` int(11) DEFAULT NULL,
  `top_money` bigint(20) DEFAULT NULL,
  `is_pay` tinyint(1) DEFAULT '0',
  `is_lock` tinyint(1) DEFAULT '0',
  `is_pay_time` int(11) DEFAULT '0',
  `order_no` varchar(100) DEFAULT NULL,
  `sort` int(11) DEFAULT '0',
  `views` int(11) DEFAULT '0' COMMENT '阅读人数',
  `like` int(11) DEFAULT '0' COMMENT '点赞人数',
  `like_face` text,
  `reply_num` int(11) DEFAULT '0' COMMENT '评论人数',
  `create_time` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Table structure for ai_allwin_info_cate
-- ----------------------------
DROP TABLE IF EXISTS `ai_allwin_info_cate`;
CREATE TABLE `ai_allwin_info_cate` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `member_miniapp_id` int(11) DEFAULT NULL,
  `title` varchar(50) DEFAULT NULL,
  `name` varchar(50) DEFAULT NULL,
  `picture` varchar(100) DEFAULT NULL,
  `tpl_id` int(11) DEFAULT NULL,
  `sort` int(11) DEFAULT '0',
  `update_time` int(11) DEFAULT NULL,
  `create_time` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `ID` (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='信息栏目';

-- ----------------------------
-- Table structure for ai_allwin_info_config
-- ----------------------------
DROP TABLE IF EXISTS `ai_allwin_info_config`;
CREATE TABLE `ai_allwin_info_config` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `member_miniapp_id` int(11) DEFAULT NULL,
  `topday` varchar(255) DEFAULT NULL COMMENT '置顶',
  `charge` tinyint(4) DEFAULT '0',
  `bring` tinyint(4) DEFAULT NULL,
  `reward` tinyint(4) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Table structure for ai_allwin_info_follow
-- ----------------------------
DROP TABLE IF EXISTS `ai_allwin_info_follow`;
CREATE TABLE `ai_allwin_info_follow` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `uid` int(11) DEFAULT NULL,
  `like_uid` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='关注与取消';

-- ----------------------------
-- Table structure for ai_allwin_info_mp
-- ----------------------------
DROP TABLE IF EXISTS `ai_allwin_info_mp`;
CREATE TABLE `ai_allwin_info_mp` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `member_miniapp_id` int(11) DEFAULT NULL,
  `uid` bigint(20) DEFAULT NULL,
  `logo` varchar(100) DEFAULT NULL,
  `skin` varchar(255) DEFAULT NULL,
  `title` varchar(100) DEFAULT NULL,
  `note` varchar(100) DEFAULT NULL,
  `is_vip` tinyint(1) DEFAULT '0',
  `is_apply` tinyint(1) DEFAULT '0',
  `vip_title` varchar(100) DEFAULT NULL,
  `vip_about` varchar(255) DEFAULT NULL,
  `vip_time` int(11) DEFAULT NULL,
  `reg_time` int(11) DEFAULT NULL,
  `is_lock` tinyint(1) DEFAULT '0',
  `fans` int(255) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Table structure for ai_allwin_info_order
-- ----------------------------
DROP TABLE IF EXISTS `ai_allwin_info_order`;
CREATE TABLE `ai_allwin_info_order` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `member_miniapp_id` int(11) DEFAULT NULL,
  `info_id` int(11) DEFAULT NULL,
  `info_uid` int(11) DEFAULT NULL,
  `uid` int(11) DEFAULT NULL,
  `status` tinyint(1) DEFAULT '0',
  `is_del` tinyint(1) DEFAULT '0',
  `phone` varchar(255) DEFAULT NULL,
  `amount` decimal(10,2) DEFAULT '0.00' COMMENT '单商品价格总额',
  `order_no` varchar(50) DEFAULT NULL,
  `paid_at` tinyint(1) DEFAULT '0',
  `paid_time` int(11) DEFAULT NULL,
  `paid_no` varchar(255) DEFAULT NULL,
  `message` varchar(255) DEFAULT NULL,
  `fields` text,
  `cache` text,
  `create_time` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `ORDER_NO` (`order_no`) USING BTREE,
  KEY `IS_DEL` (`is_del`) USING BTREE,
  KEY `STATUS` (`status`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Table structure for ai_allwin_info_reply
-- ----------------------------
DROP TABLE IF EXISTS `ai_allwin_info_reply`;
CREATE TABLE `ai_allwin_info_reply` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `member_miniapp_id` int(11) DEFAULT NULL,
  `user_id` bigint(20) DEFAULT NULL,
  `info_id` int(11) DEFAULT NULL,
  `reply` varchar(255) DEFAULT NULL,
  `like` int(11) DEFAULT '0',
  `create_time` int(11) DEFAULT NULL,
  `state` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8;

-- ----------------------------
-- Table structure for ai_allwin_info_share
-- ----------------------------
DROP TABLE IF EXISTS `ai_allwin_info_share`;
CREATE TABLE `ai_allwin_info_share` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `uid` bigint(20) DEFAULT NULL,
  `info_id` bigint(20) DEFAULT NULL,
  `views` int(11) DEFAULT NULL,
  `times` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Table structure for ai_allwin_info_tpl
-- ----------------------------
DROP TABLE IF EXISTS `ai_allwin_info_tpl`;
CREATE TABLE `ai_allwin_info_tpl` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `member_miniapp_id` int(11) DEFAULT NULL,
  `name` varchar(20) DEFAULT NULL,
  `is_shop` tinyint(1) DEFAULT '0',
  `button_name` varchar(20) DEFAULT NULL,
  `tips` varchar(255) DEFAULT NULL,
  `users` text,
  `fields` text,
  `update_time` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='商品规格';

-- ----------------------------
-- Table structure for ai_allwin_mch
-- ----------------------------
DROP TABLE IF EXISTS `ai_allwin_mch`;
CREATE TABLE `ai_allwin_mch` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `member_miniapp_id` int(11) DEFAULT NULL,
  `member_id` int(11) DEFAULT NULL,
  `mchid` bigint(20) DEFAULT NULL,
  `store_name` varchar(255) DEFAULT NULL,
  `merchant_shortname` varchar(100) DEFAULT NULL,
  `store_street` varchar(255) DEFAULT NULL,
  `contact_phone` varchar(20) DEFAULT NULL,
  `applyment_id` varchar(100) DEFAULT NULL,
  `store_entrance_pic` varchar(255) DEFAULT NULL,
  `store_entrance_pic_media_id` varchar(255) DEFAULT NULL,
  `indoor_pic` varchar(255) DEFAULT NULL,
  `indoor_pic_media_id` varchar(255) DEFAULT NULL,
  `product_desc` varchar(255) DEFAULT NULL,
  `id_card_valid_time` varchar(255) DEFAULT NULL,
  `id_card_name` varchar(30) DEFAULT NULL,
  `id_card_number` varchar(30) DEFAULT NULL,
  `id_card_copy` varchar(255) DEFAULT NULL,
  `id_card_copy_media_id` varchar(255) DEFAULT NULL,
  `id_card_national` varchar(255) DEFAULT NULL,
  `id_card_national_media_id` varchar(255) DEFAULT NULL,
  `id_card_start_time` varchar(100) DEFAULT NULL,
  `id_card_end_time` varchar(100) DEFAULT NULL,
  `account_bank` varchar(100) DEFAULT NULL,
  `account_number` varchar(50) DEFAULT NULL,
  `bank_address_code` varchar(30) DEFAULT NULL,
  `business_code` varchar(50) DEFAULT NULL,
  `is_types` tinyint(1) DEFAULT '0' COMMENT '0普通商户1小微商户',
  `is_default` tinyint(1) DEFAULT '0' COMMENT '1默认',
  `is_pass` tinyint(1) DEFAULT '0' COMMENT '0待提审1审核中2通过-1失败',
  `is_delete` tinyint(1) DEFAULT '0' COMMENT '允许删除0允许 1不允许',
  `status` tinyint(1) DEFAULT '0' COMMENT '1锁定0正常',
  `create_time` int(11) DEFAULT NULL,
  `update_time` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Table structure for ai_allwin_mch_queen
-- ----------------------------
DROP TABLE IF EXISTS `ai_allwin_mch_queen`;
CREATE TABLE `ai_allwin_mch_queen` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `member_miniapp_id` int(11) DEFAULT NULL,
  `types` tinyint(1) DEFAULT '0' COMMENT '0:open|1:mchid',
  `store_id` bigint(20) DEFAULT NULL,
  `uid` bigint(20) DEFAULT NULL,
  `mch_id` bigint(20) DEFAULT NULL,
  `amount` int(11) DEFAULT NULL,
  `transaction_id` varchar(64) DEFAULT NULL,
  `out_order_no` varchar(64) DEFAULT NULL,
  `order_id` varchar(64) DEFAULT NULL,
  `is_finish` tinyint(1) DEFAULT NULL COMMENT '0排队1失败2成',
  `msg` varchar(255) DEFAULT NULL,
  `sms` varchar(255) DEFAULT NULL,
  `update_time` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Table structure for ai_allwin_mch_user
-- ----------------------------
DROP TABLE IF EXISTS `ai_allwin_mch_user`;
CREATE TABLE `ai_allwin_mch_user` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `member_miniapp_id` int(11) DEFAULT NULL,
  `store_id` int(11) DEFAULT NULL,
  `types` tinyint(1) DEFAULT '0' COMMENT '0:open|1:mchid',
  `mch_id` bigint(20) DEFAULT NULL,
  `uid` bigint(20) DEFAULT NULL,
  `openid` varchar(100) DEFAULT NULL,
  `receiver` text,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Table structure for ai_allwin_member
-- ----------------------------
DROP TABLE IF EXISTS `ai_allwin_member`;
CREATE TABLE `ai_allwin_member` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `member_miniapp_id` int(11) DEFAULT NULL,
  `member_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Table structure for ai_allwin_netdata
-- ----------------------------
DROP TABLE IF EXISTS `ai_allwin_netdata`;
CREATE TABLE `ai_allwin_netdata` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `member_miniapp_id` int(11) DEFAULT NULL,
  `views` bigint(20) DEFAULT '0',
  `info` bigint(20) DEFAULT '0',
  `store` bigint(20) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Table structure for ai_allwin_news
-- ----------------------------
DROP TABLE IF EXISTS `ai_allwin_news`;
CREATE TABLE `ai_allwin_news` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `member_miniapp_id` int(11) DEFAULT NULL,
  `cate_id` int(11) DEFAULT NULL,
  `cate_name` varchar(255) DEFAULT NULL,
  `types` tinyint(255) DEFAULT NULL,
  `title` varchar(255) DEFAULT NULL,
  `content` longtext,
  `desc` varchar(255) DEFAULT NULL,
  `img` varchar(255) DEFAULT NULL,
  `views` bigint(20) DEFAULT '0',
  `update_time` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Table structure for ai_allwin_news_cate
-- ----------------------------
DROP TABLE IF EXISTS `ai_allwin_news_cate`;
CREATE TABLE `ai_allwin_news_cate` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `member_miniapp_id` int(11) DEFAULT NULL,
  `title` varchar(50) DEFAULT NULL,
  `name` varchar(50) DEFAULT NULL,
  `picture` varchar(100) DEFAULT NULL,
  `sort` int(11) DEFAULT '0',
  `update_time` int(11) DEFAULT NULL,
  `create_time` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `ID` (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='新闻分类';

-- ----------------------------
-- Table structure for ai_allwin_order
-- ----------------------------
DROP TABLE IF EXISTS `ai_allwin_order`;
CREATE TABLE `ai_allwin_order` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `member_miniapp_id` int(11) DEFAULT NULL,
  `store_id` int(11) DEFAULT NULL,
  `uid` bigint(20) DEFAULT NULL,
  `coupon_user_id` int(11) DEFAULT NULL,
  `coupon_ids` varchar(255) DEFAULT NULL,
  `order_no` varchar(255) DEFAULT NULL,
  `user_amount` decimal(10,2) DEFAULT NULL COMMENT '输入金额',
  `coupon_price` decimal(10,2) DEFAULT NULL COMMENT '优惠金额',
  `platform_amount` decimal(10,2) DEFAULT NULL COMMENT '领赠品金额',
  `store_amount` decimal(10,2) DEFAULT NULL COMMENT '好店应收',
  `order_amount` decimal(10,2) DEFAULT NULL COMMENT '实支付金额',
  `state` tinyint(2) DEFAULT '0',
  `paid_time` int(11) DEFAULT NULL,
  `paid_no` varchar(255) DEFAULT NULL,
  `update_time` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Table structure for ai_allwin_platform
-- ----------------------------
DROP TABLE IF EXISTS `ai_allwin_platform`;
CREATE TABLE `ai_allwin_platform` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `member_miniapp_id` int(11) DEFAULT NULL,
  `platform` decimal(10,2) DEFAULT NULL,
  `company` decimal(10,2) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Table structure for ai_allwin_shop
-- ----------------------------
DROP TABLE IF EXISTS `ai_allwin_shop`;
CREATE TABLE `ai_allwin_shop` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `store_id` int(11) DEFAULT NULL,
  `member_miniapp_id` int(11) DEFAULT NULL,
  `category_id` bigint(20) DEFAULT NULL,
  `coupon_id` bigint(20) DEFAULT NULL,
  `is_sale` tinyint(1) DEFAULT '0' COMMENT '0:下架、1:上架',
  `is_del` tinyint(1) DEFAULT '0',
  `name` varchar(255) DEFAULT NULL,
  `title` varchar(255) DEFAULT NULL,
  `sell_price` decimal(10,2) NOT NULL DEFAULT '0.00',
  `market_price` decimal(10,2) DEFAULT '0.00',
  `cost_price` decimal(10,2) DEFAULT '0.00',
  `vip_price` decimal(10,2) DEFAULT NULL,
  `warehouse_num` int(11) DEFAULT '0',
  `warehouse_sellnum` int(11) DEFAULT '0',
  `points` int(11) DEFAULT NULL,
  `imgs` text,
  `img` varchar(255) DEFAULT NULL,
  `group_title` varchar(255) DEFAULT NULL,
  `group_note` varchar(255) DEFAULT NULL,
  `group_img` varchar(255) DEFAULT NULL,
  `keyword` varchar(255) DEFAULT NULL,
  `notice` text,
  `like` int(11) DEFAULT '0',
  `share_ids` text,
  `share_price` int(11) DEFAULT NULL,
  `detective_uid` int(11) DEFAULT NULL,
  `detective_price` int(11) DEFAULT NULL,
  `content` mediumtext,
  `sort` int(11) DEFAULT '0',
  `types` tinyint(1) DEFAULT '0',
  `end_time` int(11) DEFAULT NULL,
  `update_time` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `ID` (`id`) USING BTREE,
  KEY `IS_SALE` (`is_sale`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='商品主表';

-- ----------------------------
-- Table structure for ai_allwin_shop_cate
-- ----------------------------
DROP TABLE IF EXISTS `ai_allwin_shop_cate`;
CREATE TABLE `ai_allwin_shop_cate` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `member_miniapp_id` int(11) DEFAULT NULL,
  `types` tinyint(1) DEFAULT '0',
  `title` varchar(50) DEFAULT NULL,
  `content` varchar(255) DEFAULT NULL,
  `picture` varchar(100) DEFAULT NULL,
  `sort` int(11) DEFAULT '0',
  `update_time` int(11) DEFAULT NULL,
  `create_time` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `ID` (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='商品目录';

-- ----------------------------
-- Table structure for ai_allwin_shop_coupon
-- ----------------------------
DROP TABLE IF EXISTS `ai_allwin_shop_coupon`;
CREATE TABLE `ai_allwin_shop_coupon` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `member_miniapp_id` int(11) DEFAULT NULL,
  `coupon_id` int(11) DEFAULT NULL,
  `shop_id` int(11) DEFAULT NULL,
  `create_time` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `STOREID` (`coupon_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='支付有礼';

-- ----------------------------
-- Table structure for ai_allwin_shop_order
-- ----------------------------
DROP TABLE IF EXISTS `ai_allwin_shop_order`;
CREATE TABLE `ai_allwin_shop_order` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `member_miniapp_id` int(11) DEFAULT NULL,
  `store_id` int(11) DEFAULT NULL,
  `user_id` int(11) DEFAULT NULL,
  `share_uid` int(11) DEFAULT NULL,
  `phone` varchar(255) DEFAULT NULL,
  `shop_id` int(11) DEFAULT NULL,
  `order_no` varchar(50) DEFAULT NULL,
  `status` tinyint(1) DEFAULT '0',
  `is_del` tinyint(1) DEFAULT '0',
  `sell_price` decimal(10,2) DEFAULT '0.00',
  `amount` decimal(10,2) DEFAULT '0.00' COMMENT '单商品价格总额',
  `points` int(11) DEFAULT NULL,
  `thrifty` decimal(10,2) DEFAULT NULL,
  `create_time` int(11) DEFAULT NULL,
  `paid_at` tinyint(1) DEFAULT '0',
  `paid_time` int(11) DEFAULT NULL,
  `paid_no` varchar(255) DEFAULT NULL,
  `message` varchar(255) DEFAULT NULL,
  `shop_cache` text,
  PRIMARY KEY (`id`),
  UNIQUE KEY `ORDER_NO` (`order_no`) USING BTREE,
  KEY `IS_DEL` (`is_del`) USING BTREE,
  KEY `STATUS` (`status`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Table structure for ai_allwin_store
-- ----------------------------
DROP TABLE IF EXISTS `ai_allwin_store`;
CREATE TABLE `ai_allwin_store` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `code_id` char(12) DEFAULT NULL,
  `member_miniapp_id` int(11) DEFAULT NULL,
  `manage_uid` int(11) DEFAULT NULL,
  `mch_id` int(11) DEFAULT NULL,
  `charges` int(4) DEFAULT '0',
  `cate_id` int(11) DEFAULT NULL,
  `cate_sid` int(11) DEFAULT NULL,
  `money_coupon` int(11) DEFAULT NULL,
  `cate_name` varchar(255) DEFAULT NULL,
  `name` varchar(255) DEFAULT NULL,
  `img` varchar(255) DEFAULT NULL,
  `imgs` text,
  `work_time` varchar(50) DEFAULT NULL,
  `address` varchar(255) DEFAULT NULL,
  `telphone` varchar(255) DEFAULT NULL,
  `tips` varchar(255) DEFAULT NULL,
  `state` tinyint(1) DEFAULT '0',
  `state_text` varchar(50) DEFAULT NULL,
  `tags` varchar(255) DEFAULT NULL,
  `score` int(5) DEFAULT '0' COMMENT '评分',
  `rate_value` int(10) DEFAULT '3' COMMENT '推荐值',
  `sort` int(11) DEFAULT NULL,
  `views` int(11) DEFAULT '0',
  `longitude` decimal(10,7) DEFAULT NULL COMMENT '地图坐标',
  `latitude` decimal(10,7) DEFAULT NULL,
  `is_top` tinyint(1) DEFAULT NULL,
  `is_default` tinyint(1) DEFAULT '0' COMMENT '是否默认首页商铺',
  `is_lock` tinyint(1) DEFAULT '0',
  `quan_id` int(11) DEFAULT '0',
  `create_time` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `CODEID` (`code_id`),
  KEY `APPID` (`member_miniapp_id`),
  KEY `CID` (`cate_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Table structure for ai_allwin_store_bill
-- ----------------------------
DROP TABLE IF EXISTS `ai_allwin_store_bill`;
CREATE TABLE `ai_allwin_store_bill` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `member_miniapp_id` int(11) DEFAULT NULL,
  `store_id` int(11) DEFAULT '0',
  `pay_uid` bigint(20) DEFAULT '0',
  `money` decimal(10,2) DEFAULT '0.00',
  `message` tinytext,
  `update_time` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `ID` (`id`) USING BTREE,
  KEY `STORE_ID` (`store_id`),
  KEY `UID` (`pay_uid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='好店收入账单';

-- ----------------------------
-- Table structure for ai_allwin_store_cate
-- ----------------------------
DROP TABLE IF EXISTS `ai_allwin_store_cate`;
CREATE TABLE `ai_allwin_store_cate` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `member_miniapp_id` int(11) DEFAULT NULL,
  `parent_id` int(11) DEFAULT '0',
  `root_id` int(11) DEFAULT NULL,
  `title` varchar(50) DEFAULT NULL,
  `name` varchar(50) DEFAULT NULL,
  `picture` varchar(100) DEFAULT NULL,
  `sort` int(11) DEFAULT '0',
  `update_time` int(11) DEFAULT NULL,
  `create_time` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `ID` (`id`) USING BTREE,
  KEY `PARENT_ID` (`parent_id`,`root_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='分类信息栏目';

-- ----------------------------
-- Table structure for ai_allwin_store_chain
-- ----------------------------
DROP TABLE IF EXISTS `ai_allwin_store_chain`;
CREATE TABLE `ai_allwin_store_chain` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `member_miniapp_id` int(11) DEFAULT NULL,
  `code_id` bigint(12) DEFAULT NULL,
  `types` tinyint(1) DEFAULT '0',
  `store_id` int(11) DEFAULT NULL,
  `title` varchar(100) DEFAULT NULL,
  `address` varchar(255) DEFAULT NULL,
  `telphone` varchar(50) DEFAULT NULL,
  `longitude` varchar(20) DEFAULT NULL,
  `latitude` varchar(20) DEFAULT NULL,
  `update_time` int(11) DEFAULT NULL,
  `sort` int(11) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='连锁门店';

-- ----------------------------
-- Table structure for ai_allwin_store_quan
-- ----------------------------
DROP TABLE IF EXISTS `ai_allwin_store_quan`;
CREATE TABLE `ai_allwin_store_quan` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `member_miniapp_id` int(11) DEFAULT NULL,
  `title` varchar(50) DEFAULT NULL,
  `content` varchar(50) DEFAULT NULL,
  `picture` varchar(100) DEFAULT NULL,
  `create_time` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `ID` (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='分类信息栏目';

-- ----------------------------
-- Table structure for ai_allwin_store_stats
-- ----------------------------
DROP TABLE IF EXISTS `ai_allwin_store_stats`;
CREATE TABLE `ai_allwin_store_stats` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `member_miniapp_id` int(11) DEFAULT NULL,
  `store_id` int(11) DEFAULT NULL,
  `payment` decimal(10,2) DEFAULT '0.00',
  `coupon` decimal(10,2) DEFAULT '0.00',
  `card` decimal(10,2) DEFAULT '0.00',
  `vip` decimal(10,2) DEFAULT '0.00',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='店铺数据统计';

-- ----------------------------
-- Table structure for ai_allwin_store_union
-- ----------------------------
DROP TABLE IF EXISTS `ai_allwin_store_union`;
CREATE TABLE `ai_allwin_store_union` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `store_id` int(11) DEFAULT NULL,
  `store_union` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Table structure for ai_allwin_store_worker
-- ----------------------------
DROP TABLE IF EXISTS `ai_allwin_store_worker`;
CREATE TABLE `ai_allwin_store_worker` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `member_miniapp_id` int(11) DEFAULT NULL,
  `store_id` int(11) DEFAULT NULL,
  `uid` bigint(20) DEFAULT NULL,
  `is_cashier` tinyint(1) DEFAULT '0' COMMENT '是否收银员',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='工作人员';

-- ----------------------------
-- Table structure for ai_allwin_unmarket
-- ----------------------------
DROP TABLE IF EXISTS `ai_allwin_unmarket`;
CREATE TABLE `ai_allwin_unmarket` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `uid` int(11) DEFAULT NULL,
  `member_miniapp_id` int(11) DEFAULT NULL,
  `bonus_types` tinyint(2) DEFAULT NULL,
  `bonus_user_types` tinyint(2) DEFAULT NULL,
  `share_ratio` int(10) DEFAULT NULL,
  `share_ratio_user` int(10) DEFAULT NULL,
  `price` decimal(10,2) DEFAULT NULL,
  `title` varchar(255) DEFAULT NULL,
  `share_img` varchar(100) DEFAULT NULL,
  `share_title` varchar(50) DEFAULT NULL,
  `share_text` varchar(100) DEFAULT NULL,
  `music` varchar(255) DEFAULT NULL,
  `note` text,
  `img` varchar(255) DEFAULT NULL,
  `imgs` text,
  `start_time` int(11) DEFAULT NULL,
  `end_time` int(11) DEFAULT NULL,
  `telphone` varchar(100) DEFAULT NULL,
  `mycode` varchar(255) DEFAULT NULL,
  `tips` text,
  `views` int(11) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='团购联盟';

-- ----------------------------
-- Table structure for ai_allwin_unmarket_booking
-- ----------------------------
DROP TABLE IF EXISTS `ai_allwin_unmarket_booking`;
CREATE TABLE `ai_allwin_unmarket_booking` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `member_miniapp_id` int(11) DEFAULT NULL,
  `union_id` int(11) DEFAULT NULL,
  `store_name` varchar(255) DEFAULT NULL,
  `name` varchar(255) DEFAULT NULL,
  `telphone` varchar(255) DEFAULT NULL,
  `create_time` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='团购联盟';

-- ----------------------------
-- Table structure for ai_allwin_unmarket_order
-- ----------------------------
DROP TABLE IF EXISTS `ai_allwin_unmarket_order`;
CREATE TABLE `ai_allwin_unmarket_order` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `uid` bigint(20) DEFAULT NULL,
  `share_uid` bigint(20) DEFAULT NULL,
  `order_sn` varchar(255) NOT NULL,
  `share_id` int(11) NOT NULL,
  `order_time` int(11) NOT NULL,
  `member_miniapp_id` int(11) NOT NULL,
  `price` decimal(10,2) NOT NULL,
  `redpack` decimal(10,2) DEFAULT NULL,
  `state` tinyint(1) DEFAULT NULL,
  `telname` varchar(255) DEFAULT NULL,
  `telphone` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `ORDERSN` (`order_sn`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='团购联盟';

-- ----------------------------
-- Table structure for ai_allwin_unmarket_reward
-- ----------------------------
DROP TABLE IF EXISTS `ai_allwin_unmarket_reward`;
CREATE TABLE `ai_allwin_unmarket_reward` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `member_miniapp_id` int(11) NOT NULL,
  `union_id` int(11) DEFAULT NULL,
  `uid` int(11) DEFAULT NULL,
  `number` int(11) DEFAULT '0',
  `money` decimal(10,2) DEFAULT NULL,
  `update_time` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COMMENT='团购联盟';

-- ----------------------------
-- Table structure for ai_allwin_unmarket_store
-- ----------------------------
DROP TABLE IF EXISTS `ai_allwin_unmarket_store`;
CREATE TABLE `ai_allwin_unmarket_store` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `store_id` int(11) DEFAULT NULL,
  `union_id` int(11) DEFAULT NULL,
  `member_miniapp_id` int(11) NOT NULL,
  `img` varchar(255) DEFAULT NULL,
  `imgs` text,
  `name` varchar(255) DEFAULT NULL,
  `address` varchar(255) DEFAULT NULL,
  `telphone` varchar(255) DEFAULT NULL,
  `endtime` int(11) DEFAULT NULL,
  `content` text,
  `note` text,
  `about` text,
  `pictext` text,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='团购联盟';

-- ----------------------------
-- Table structure for ai_allwin_unmarket_verif
-- ----------------------------
DROP TABLE IF EXISTS `ai_allwin_unmarket_verif`;
CREATE TABLE `ai_allwin_unmarket_verif` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `member_miniapp_id` int(11) NOT NULL,
  `uid` int(11) DEFAULT NULL,
  `union_id` int(11) DEFAULT NULL,
  `store_id` int(11) DEFAULT NULL,
  `times` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='团购联盟';

-- ----------------------------
-- Table structure for ai_allwin_user
-- ----------------------------
DROP TABLE IF EXISTS `ai_allwin_user`;
CREATE TABLE `ai_allwin_user` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `uid` bigint(20) DEFAULT NULL,
  `store_id` bigint(20) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `UID` (`uid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Table structure for ai_allwin_user_agent
-- ----------------------------
DROP TABLE IF EXISTS `ai_allwin_user_agent`;
CREATE TABLE `ai_allwin_user_agent` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `member_miniapp_id` int(11) DEFAULT NULL,
  `uid` bigint(11) DEFAULT NULL,
  `is_type` tinyint(2) DEFAULT '0' COMMENT '0后台 1前台申请',
  `is_pass` tinyint(2) DEFAULT NULL COMMENT '0',
  `is_lock` tinyint(2) DEFAULT NULL COMMENT '0',
  `price` decimal(10,2) DEFAULT NULL COMMENT '0',
  `order_no` varchar(50) DEFAULT NULL COMMENT '订单号',
  `wechat_order` varchar(50) DEFAULT NULL COMMENT '微信订单号',
  `pay_state` tinyint(2) DEFAULT '0' COMMENT '0未支付 1支付 2免费',
  `create_time` int(11) DEFAULT NULL,
  `paid_time` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Table structure for ai_allwin_user_level
-- ----------------------------
DROP TABLE IF EXISTS `ai_allwin_user_level`;
CREATE TABLE `ai_allwin_user_level` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `user_id` bigint(20) NOT NULL DEFAULT '0',
  `parent_id` bigint(20) NOT NULL DEFAULT '0',
  `level` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `level` (`level`),
  KEY `parent_id` (`parent_id`),
  KEY `user_id` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='用户关系表';

-- ----------------------------
-- Table structure for ai_allwin_user_worker
-- ----------------------------
DROP TABLE IF EXISTS `ai_allwin_user_worker`;
CREATE TABLE `ai_allwin_user_worker` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `member_miniapp_id` int(11) DEFAULT NULL,
  `uid` bigint(11) DEFAULT NULL,
  `store_ids` varchar(255) DEFAULT NULL,
  `is_pass` tinyint(2) DEFAULT NULL COMMENT '0待审核 1通过',
  `is_lock` tinyint(2) DEFAULT NULL COMMENT '0正常 1锁定',
  `is_type` tinyint(2) DEFAULT '0' COMMENT '0后台 1前台申请',
  `price` decimal(10,2) DEFAULT NULL,
  `order_no` varchar(50) DEFAULT NULL COMMENT '订单号',
  `wechat_order` varchar(50) DEFAULT NULL COMMENT '微信订单号',
  `pay_state` tinyint(2) DEFAULT NULL COMMENT '0未支付 1支付',
  `create_time` int(11) DEFAULT NULL,
  `paid_time` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='公司员工';

-- ----------------------------
-- Table structure for ai_allwin_user_worker_store_order
-- ----------------------------
DROP TABLE IF EXISTS `ai_allwin_user_worker_store_order`;
CREATE TABLE `ai_allwin_user_worker_store_order` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `member_miniapp_id` int(11) DEFAULT NULL,
  `uid` bigint(11) DEFAULT NULL,
  `store_id` int(11) DEFAULT NULL,
  `is_type` tinyint(2) DEFAULT '0' COMMENT '0后台 1前台申请',
  `price` decimal(10,2) DEFAULT NULL,
  `total_price` decimal(10,2) DEFAULT NULL,
  `order_no` varchar(50) DEFAULT NULL COMMENT '订单号',
  `wechat_order` varchar(50) DEFAULT NULL COMMENT '微信订单号',
  `pay_state` tinyint(2) DEFAULT '0' COMMENT '0未支付 1支付 2免费',
  `create_time` int(11) DEFAULT NULL,
  `paid_time` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='业务经理申请';

-- ----------------------------
-- Table structure for ai_allwin_vip
-- ----------------------------
DROP TABLE IF EXISTS `ai_allwin_vip`;
CREATE TABLE `ai_allwin_vip` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `member_miniapp_id` int(11) DEFAULT NULL,
  `user_id` int(11) DEFAULT NULL,
  `store_id` int(11) DEFAULT '0',
  `vipcard_id` int(11) DEFAULT NULL,
  `is_up` tinyint(1) DEFAULT '0',
  `is_diy` tinyint(1) DEFAULT '0',
  `coupon_ids` varchar(255) DEFAULT NULL,
  `order_no` varchar(255) DEFAULT NULL,
  `amount` decimal(10,2) DEFAULT NULL,
  `state` tinyint(1) DEFAULT '0',
  `is_lock` tinyint(1) DEFAULT '0',
  `paid_time` int(11) DEFAULT NULL,
  `paid_no` varchar(255) DEFAULT NULL,
  `update_time` int(11) DEFAULT NULL,
  `from_ucode` varchar(20) DEFAULT NULL,
  `is_divided` tinyint(1) DEFAULT '0' COMMENT '是否已经分润',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Table structure for ai_allwin_vipcard
-- ----------------------------
DROP TABLE IF EXISTS `ai_allwin_vipcard`;
CREATE TABLE `ai_allwin_vipcard` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `city_id` int(11) DEFAULT NULL,
  `member_miniapp_id` int(11) DEFAULT NULL,
  `is_up` tinyint(1) DEFAULT '0',
  `theme` varchar(255) DEFAULT NULL,
  `name` varchar(255) DEFAULT NULL,
  `coupon_num` int(11) DEFAULT NULL,
  `price` decimal(10,2) DEFAULT NULL,
  `tips` varchar(255) DEFAULT NULL,
  `store_workers` decimal(10,2) DEFAULT NULL,
  `store` decimal(10,2) DEFAULT NULL,
  `company_workers` decimal(10,2) DEFAULT NULL,
  `company` decimal(10,2) DEFAULT NULL,
  `stock` decimal(10,2) DEFAULT NULL,
  `group` decimal(10,2) DEFAULT NULL,
  `coupon_ids` text,
  `is_tax` tinyint(1) DEFAULT '0',
  `rule` text,
  `nominate` tinyint(4) DEFAULT '0',
  `sort` int(11) DEFAULT '0',
  `update_time` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
SET FOREIGN_KEY_CHECKS=1;
