canyin-project/ybcy/update.php

2162 lines
112 KiB
PHP
Raw Normal View History

2024-11-01 16:07:54 +08:00
<?php
//////////2020-09-18////////
if (!pdo_fieldexists(tablename('ybwm_core_goods'), 'isAttr')) {
pdo_query("ALTER TABLE" . tablename('ybwm_core_goods') . " ADD `isAttr` int(11) DEFAULT '2' COMMENT '是否有属性 2无属性 1有属性'; ");
}
if (!pdo_fieldexists(tablename('ybwm_core_goods'), 'isMaterial')) {
pdo_query("ALTER TABLE" . tablename('ybwm_core_goods') . " ADD `isMaterial` int(11) DEFAULT '2' COMMENT '2无加料 1有加料'; ");
}
pdo_query("ALTER TABLE " . tablename('ybwm_good_materia') . " CHANGE `SalesPrice` `SalesPrice` DECIMAL(10,2) NOT NULL;");
pdo_query("ALTER TABLE " . tablename('ybwm_good_specs') . " CHANGE `SalesPrice` `SalesPrice` DECIMAL(10,2) NOT NULL;");
pdo_query("CREATE TABLE IF NOT EXISTS " . tablename('ybwm_goods_visit') . "(
`id` int(11) NOT NULL AUTO_INCREMENT,
`uniacid` int(11) DEFAULT NULL,
`storeId` int(11) DEFAULT NULL,
`goodsId` int(11) DEFAULT NULL,
`createdAt` int(11) DEFAULT NULL,
`ip` varchar(30) DEFAULT NULL,
`type` tinyint(1) DEFAULT NULL,
`openId` varchar(50) DEFAULT NULL,
`userId` int(11) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;"
);
if (!pdo_fieldexists(tablename('ybwm_shop_car'), 'materialMoney')) {
pdo_query("ALTER TABLE" . tablename('ybwm_shop_car') . " ADD `materialMoney` decimal(10,2) DEFAULT NULL; ");
}
//////////2020-09-18////////
/////////////2020-09-19
if (!pdo_fieldexists(tablename('ybwm_core_label'), 'color')) {
pdo_query("ALTER TABLE" . tablename('ybwm_core_label') . " ADD `color` VARCHAR(20) NOT NULL COMMENT '颜色'; ");
}
/////////////2020-09-24
pdo_query("ALTER TABLE " . tablename('ybwm_member') . " CHANGE `balance` `balance` DECIMAL(10,2) NULL DEFAULT '0.00';");
pdo_query("ALTER TABLE " . tablename('ybwm_member') . " CHANGE `integral` `integral` INT(11) NULL DEFAULT '0';");
//////////2020-09-26
pdo_query("CREATE TABLE IF NOT EXISTS " . tablename('ybwm_delivery_preferential') . "(
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` int(11) NOT NULL COMMENT '活动名称',
`startTime` int(11) NOT NULL,
`endTime` int(11) NOT NULL,
`reductionArr` varchar(255) NOT NULL COMMENT '满减数组',
`money` decimal(10,2) NOT NULL COMMENT '立减多少',
`type` int(11) NOT NULL DEFAULT '1' COMMENT '优惠形式1.立减2.满减',
`week` varchar(255) NOT NULL COMMENT '循环周期',
`useType` int(11) NOT NULL DEFAULT '1' COMMENT '1.本店使用2全店通用3.指定门店',
`useStore` varchar(255) NOT NULL COMMENT '可用门店',
`createdAt` int(11) NOT NULL DEFAULT '0',
`changeAt` int(11) NOT NULL DEFAULT '0',
`deleteAt` int(11) NOT NULL DEFAULT '0',
`uniacid` int(11) NOT NULL DEFAULT '0',
`storeId` int(11) NOT NULL DEFAULT '0',
`display` int(11) NOT NULL DEFAULT '1' COMMENT '1.显示2隐藏',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='满减配送费';"
);
pdo_query("CREATE TABLE IF NOT EXISTS " . tablename('ybwm_coupon') . "(
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(20) NOT NULL COMMENT '活动名称',
`type` int(11) NOT NULL DEFAULT '1' COMMENT '1.优惠券2折扣券',
`money` decimal(10,2) NOT NULL COMMENT '减多少',
`fullMoney` decimal(10,2) NOT NULL COMMENT '满多少',
`discount` decimal(10,1) NOT NULL COMMENT '折扣',
`useStartTime` int(11) NOT NULL COMMENT '使用开始时间',
`useEndTime` int(11) NOT NULL COMMENT '使用结束时间',
`timeType` int(11) NOT NULL DEFAULT '1' COMMENT '1.日期范围2领取后多少天',
`day` int(11) NOT NULL COMMENT '领取后多少天',
`useType` varchar(50) NOT NULL COMMENT '使用类型1.外卖2自提',
`startTime` int(11) NOT NULL COMMENT '活动开始时间',
`endTime` int(11) NOT NULL COMMENT '活动结束时间',
`details` varchar(255) NOT NULL COMMENT '详情',
`stock` int(11) NOT NULL DEFAULT '0' COMMENT '库存',
`maxNum` int(11) NOT NULL DEFAULT '0' COMMENT '限领',
`storeType` int(11) NOT NULL DEFAULT '1' COMMENT '1.全部门店2指定',
`storeArr` varchar(255) NOT NULL COMMENT '门店id数组',
`goodsType` int(11) NOT NULL DEFAULT '1' COMMENT '1.全部商品2指定商品3.指定分类商品',
`goodsArr` varchar(255) NOT NULL COMMENT '商品或分类id数组',
`uniacid` int(11) NOT NULL,
`changeAt` int(11) NOT NULL,
`createdAt` int(11) NOT NULL,
`deleteAt` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='优惠券';"
);
pdo_query("CREATE TABLE IF NOT EXISTS " . tablename('ybwm_user_coupon') . "(
`id` int(11) NOT NULL AUTO_INCREMENT,
`userId` int(11) NOT NULL COMMENT '用户id',
`couponId` int(11) NOT NULL,
`type` int(11) NOT NULL DEFAULT '1' COMMENT '1.优惠券2折扣券',
`couponName` varchar(20) NOT NULL COMMENT '券名称',
`couponDetails` varchar(255) NOT NULL COMMENT '券详情',
`money` decimal(10,2) NOT NULL,
`fullMoney` decimal(10,2) NOT NULL,
`discount` int(11) NOT NULL,
`useStartTime` int(11) NOT NULL COMMENT '使用开始时间',
`useEndTime` int(11) NOT NULL COMMENT '使用结束时间',
`useType` varchar(20) NOT NULL COMMENT '使用类型数组1外卖2自提',
`storeType` int(11) NOT NULL COMMENT '1.全部门店2指定',
`storeArr` varchar(255) NOT NULL COMMENT '门店数组',
`goodsType` int(11) NOT NULL COMMENT '1.全部2指定商品3指定商品分类',
`goodsArr` varchar(255) NOT NULL COMMENT '商品或商品分类id数组',
`state` int(11) NOT NULL DEFAULT '2' COMMENT '1.已使用2未使用',
`useTime` int(11) NOT NULL COMMENT '使用时间',
`uniacid` int(11) NOT NULL,
`createdAt` int(11) NOT NULL COMMENT '领取时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='用户领取的优惠券';"
);
if (!pdo_fieldexists(tablename('ybwm_bill'), 'entryAt')) {
pdo_query("ALTER TABLE" . tablename('ybwm_bill') . " ADD `entryAt` int(11) NOT NULL COMMENT '入账时间'; ");
}
pdo_query("CREATE TABLE IF NOT EXISTS " . tablename('ybwm_new_reduction') . "(
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(20) NOT NULL COMMENT '活动名称',
`startTime` int(11) NOT NULL COMMENT '开始时间',
`endTime` int(11) NOT NULL COMMENT '结束时间',
`money` decimal(10,2) NOT NULL COMMENT '立减金额',
`useType` int(11) NOT NULL DEFAULT '1' COMMENT '1.门店可用2.全店通用3.指定门店可用',
`useStore` varchar(255) NOT NULL COMMENT '指定门店数组',
`createdAt` int(11) NOT NULL,
`changeAt` int(11) NOT NULL,
`deleteAt` int(11) NOT NULL,
`storeId` int(11) NOT NULL COMMENT '门店id',
`uniacid` int(11) NOT NULL,
`display` int(11) NOT NULL DEFAULT '1' COMMENT '1.显示2隐藏',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='新客立减';"
);
//////2020-09-27
if (!pdo_fieldexists(tablename('ybwm_member'), 'userType')) {
pdo_query("ALTER TABLE" . tablename('ybwm_member') . " ADD `userType` int(11) DEFAULT '1' COMMENT '用户来源1微信小程序'; ");
}
//////2020-09-30
pdo_query("ALTER TABLE " . tablename('ybwm_delivery_preferential') . " CHANGE `name` `name` varchar(20) NOT NULL COMMENT '活动名称';");
//////////2020-10-11
pdo_query("CREATE TABLE IF NOT EXISTS " . tablename('ybwm_store_reduce') . "(
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(20) NOT NULL COMMENT '活动名称',
`startTime` int(11) NOT NULL,
`endTime` int(11) NOT NULL,
`type` int(11) NOT NULL DEFAULT '1' COMMENT '1每满减优惠2.多级满减',
`moneyArr` varchar(500) NOT NULL COMMENT '满减数组',
`people` int(11) NOT NULL DEFAULT '1' COMMENT '1全部2新客3会员',
`item` varchar(50) NOT NULL COMMENT '1外卖',
`useType` int(11) NOT NULL DEFAULT '1' COMMENT '1.本店可用2全店通用3.指定门店',
`week` varchar(100) NOT NULL COMMENT '星期数组',
`timeType` int(11) NOT NULL DEFAULT '1' COMMENT '1.全天',
`storeId` int(11) NOT NULL,
`useStore` varchar(255) NOT NULL COMMENT '可用商家',
`display` int(11) NOT NULL DEFAULT '1' COMMENT '1显示2隐藏',
`deleteAt` int(11) NOT NULL DEFAULT '0',
`createdAt` int(11) NOT NULL DEFAULT '0',
`changeAt` int(11) NOT NULL DEFAULT '0',
`uniacid` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
KEY `uniacid` (`uniacid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='满减';"
);
//////2020-10-17
pdo_query("ALTER TABLE " . tablename('ybwm_user_coupon') . " CHANGE `discount` `discount` DECIMAL(10,1) NOT NULL;");
/////2020-10-19
pdo_query("ALTER TABLE " . tablename('ybwm_store') . " CHANGE `typeId` `typeId` int(11) DEFAULT '0';");
pdo_query("ALTER TABLE " . tablename('ybwm_drag') . " CHANGE `status` `status` int(11) DEFAULT '0';");
if (!pdo_fieldexists(tablename('ybwm_coupon'), 'color')) {
pdo_query("ALTER TABLE" . tablename('ybwm_coupon') . " ADD `color` varchar(20) DEFAULT '#EE472B' COMMENT '颜色' ");
}
if (!pdo_fieldexists(tablename('ybwm_coupon'), 'memberType')) {
pdo_query("ALTER TABLE" . tablename('ybwm_coupon') . " ADD `memberType` int(11) DEFAULT '1' COMMENT '1所有人2会员3指定标签用户' ");
}
if (!pdo_fieldexists(tablename('ybwm_coupon'), 'isNextDay')) {
pdo_query("ALTER TABLE" . tablename('ybwm_coupon') . " ADD `isNextDay` int(11) DEFAULT '2' COMMENT '1.此日起' ");
}
if (!pdo_fieldexists(tablename('ybwm_coupon'), 'shareImg')) {
pdo_query("ALTER TABLE" . tablename('ybwm_coupon') . " ADD `shareImg` varchar(255) DEFAULT NULL COMMENT '分享图片' ");
}
if (!pdo_fieldexists(tablename('ybwm_coupon'), 'shareTitle')) {
pdo_query("ALTER TABLE" . tablename('ybwm_coupon') . " ADD `shareTitle` varchar(255) DEFAULT NULL COMMENT '分享标题' ");
}
if (!pdo_fieldexists(tablename('ybwm_coupon'), 'display')) {
pdo_query("ALTER TABLE" . tablename('ybwm_coupon') . " ADD `display` int(11) DEFAULT '1' COMMENT '1显示2隐藏' ");
}
if (!pdo_fieldexists(tablename('ybwm_coupon'), 'storeId')) {
pdo_query("ALTER TABLE" . tablename('ybwm_coupon') . " ADD `storeId` int(11) DEFAULT NULL COMMENT '商家id' ");
}
if (!pdo_fieldexists(tablename('ybwm_coupon'), 'memberLabel')) {
pdo_query("ALTER TABLE" . tablename('ybwm_coupon') . " ADD `memberLabel` varchar(255) DEFAULT NULL COMMENT '会员标签数组' ");
}
if (!pdo_fieldexists(tablename('ybwm_coupon'), 'sort')) {
pdo_query("ALTER TABLE" . tablename('ybwm_coupon') . " ADD `sort` int(11) DEFAULT '1' COMMENT '排序' ");
}
if (!pdo_fieldexists(tablename('ybwm_coupon'), 'isFull')) {
pdo_query("ALTER TABLE" . tablename('ybwm_coupon') . " ADD `isFull` int(11) DEFAULT '1' COMMENT '1无门槛2有门槛' ");
}
if (!pdo_fieldexists(tablename('ybwm_coupon'), 'isMax')) {
pdo_query("ALTER TABLE" . tablename('ybwm_coupon') . " ADD `isMax` int(11) DEFAULT '1' COMMENT '1.不限领2.限领' ");
}
//////2020-10-26
pdo_query("CREATE TABLE IF NOT EXISTS " . tablename('ybwm_user_balance') . "(
`id` int(11) NOT NULL AUTO_INCREMENT,
`userId` int(11) NOT NULL COMMENT '用户ID',
`money` decimal(10,2) NOT NULL COMMENT '充值金额',
`createdAt` int(11) NOT NULL COMMENT '充值时间',
`uniacid` int(11) NOT NULL COMMENT '小程序ID',
`type` tinyint(4) NOT NULL DEFAULT '1' COMMENT '1加,2减',
`origin` tinyint(4) NOT NULL COMMENT '来源1平台,2用户',
`note` varchar(30) NOT NULL COMMENT '备注',
`accountId` int(11) NOT NULL,
PRIMARY KEY (`id`),
KEY `uniacid` (`uniacid`),
KEY `userId` (`userId`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;"
);
pdo_query("CREATE TABLE IF NOT EXISTS " . tablename('ybwm_user_balance_order') . "(
`id` int(11) NOT NULL AUTO_INCREMENT,
`userId` int(11) NOT NULL COMMENT '用户ID',
`money` decimal(10,2) NOT NULL COMMENT '充值金额',
`createdAt` int(11) NOT NULL COMMENT '充值时间',
`giveMoney` decimal(10,2) NOT NULL COMMENT '赠送金额',
`giveScore` int(11) NOT NULL DEFAULT '0' COMMENT '赠送积分',
`outTradeNo` varchar(100) DEFAULT NULL COMMENT '订单号',
`payMode` int(11) DEFAULT '1' COMMENT '付款方式 1微信支付2支付宝支付3.百度支付4.公众号支付',
`payAt` int(11) DEFAULT '0',
`state` int(11) DEFAULT '1' COMMENT '1未付款2已支付',
`uniacid` int(11) NOT NULL DEFAULT '0' COMMENT '小程序ID',
`giveId` int(11) DEFAULT '0' COMMENT '充值规则id',
`gradeId` int(11) DEFAULT '0' COMMENT '赠送会员等级',
`transaction_id` varchar(50) DEFAULT NULL COMMENT '微信商户号',
`subMchId` varchar(50) DEFAULT NULL COMMENT '支付的商户号',
`profitSharing` int(11) DEFAULT '2' COMMENT '1是分账2不分账',
`profitSharingState` int(11) DEFAULT '2' COMMENT '1已分账2未分账3完结分账',
`payType` int(11) DEFAULT '1' COMMENT '1普通支付2服务商支付',
`couponId` varchar(255) DEFAULT NULL COMMENT '优惠券ID',
`num` int(11) NOT NULL DEFAULT '1' COMMENT '优惠券赠送张数',
`giveGrow` int(11) DEFAULT '0' COMMENT '赠送成长值',
PRIMARY KEY (`id`),
KEY `uniacid` (`uniacid`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;"
);
pdo_query("CREATE TABLE IF NOT EXISTS " . tablename('ybwm_user_integral') . "(
`id` int(11) NOT NULL AUTO_INCREMENT,
`userId` int(11) NOT NULL COMMENT '用户ID',
`origin` tinyint(4) NOT NULL DEFAULT '1' COMMENT '来源',
`integral` int(11) NOT NULL COMMENT '积分',
`type` tinyint(4) NOT NULL DEFAULT '1' COMMENT '1加,2减',
`note` varchar(30) NOT NULL COMMENT '备注',
`createdAt` int(11) NOT NULL COMMENT '创建时间',
`uniacid` int(11) NOT NULL COMMENT '小程序ID',
`signTime` varchar(20) DEFAULT '' COMMENT '签到时间',
PRIMARY KEY (`id`),
KEY `uniacid` (`uniacid`),
KEY `userId` (`userId`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;"
);
pdo_query("CREATE TABLE IF NOT EXISTS " . tablename('ybwm_user_wallet') . "(
`id` int(11) NOT NULL AUTO_INCREMENT,
`uniacid` int(11) DEFAULT '0',
`sort` int(11) DEFAULT '1',
`name` varchar(20) DEFAULT NULL COMMENT '储值规则',
`money` decimal(10,2) DEFAULT '0.00' COMMENT '充值金额',
`giveMoney` decimal(10,2) DEFAULT '0.00' COMMENT '赠送金额',
`giveGrow` int(11) DEFAULT '0' COMMENT '赠送成长值',
`integral` int(11) DEFAULT '0' COMMENT '赠送积分',
`couponId` varchar(255) DEFAULT NULL COMMENT '赠送优惠券',
`number` int(11) DEFAULT '0' COMMENT '储值次数',
`moneyOpen` int(11) DEFAULT '2' COMMENT '赠送余额 1开启2关闭',
`integralOpen` int(11) DEFAULT '2' COMMENT '赠送积分 1开启2关闭',
`couponOpen` int(11) DEFAULT '2' COMMENT '赠送优惠券 1开启2关闭',
`growOpen` int(11) DEFAULT '2' COMMENT '赠送成长值 1开启2关闭',
`createdAt` int(11) DEFAULT '0',
`deleteAt` int(11) DEFAULT '0',
`changeAt` int(11) DEFAULT '0',
`display` int(11) NOT NULL DEFAULT '1',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;"
);
pdo_query("CREATE TABLE IF NOT EXISTS " . tablename('ybwm_give') . "(
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(20) NOT NULL,
`startTime` int(11) NOT NULL,
`endTime` int(11) NOT NULL,
`moneyArr` text NOT NULL COMMENT '优惠数组',
`item` varchar(50) NOT NULL COMMENT '支持数组 1外卖',
`week` varchar(255) NOT NULL,
`storeType` int(11) NOT NULL DEFAULT '1' COMMENT '1.门店可用2.全店通用3.指定门店可用',
`storeArr` varchar(255) NOT NULL COMMENT '门店数组',
`timeType` int(11) NOT NULL DEFAULT '1' COMMENT '1.全天',
`storeId` int(11) NOT NULL DEFAULT '0',
`createdAt` int(11) NOT NULL DEFAULT '0',
`changeAt` int(11) NOT NULL DEFAULT '0',
`deleteAt` int(11) NOT NULL DEFAULT '0',
`uniacid` int(11) NOT NULL DEFAULT '0',
`display` int(11) NOT NULL DEFAULT '1',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='满赠';"
);
if (!pdo_fieldexists(tablename('ybwm_takeout_order'), 'giveName')) {
pdo_query("ALTER TABLE" . tablename('ybwm_takeout_order') . " ADD `giveName` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '赠品' ");
}
////////2020-10-29
if (!pdo_fieldexists(tablename('ybwm_user_coupon'), 'receiveType')) {
pdo_query("ALTER TABLE" . tablename('ybwm_user_coupon') . " ADD `receiveType` int(11) DEFAULT '1' COMMENT '1.领取2签到' ");
}
if (!pdo_fieldexists(tablename('ybwm_user_integral'), 'accountId')) {
pdo_query("ALTER TABLE" . tablename('ybwm_user_integral') . " ADD `accountId` int(11) DEFAULT '0' ");
}
pdo_query("CREATE TABLE IF NOT EXISTS " . tablename('ybwm_core_ad') . "(
`id` int(11) NOT NULL AUTO_INCREMENT,
`uniacid` int(11) NOT NULL COMMENT '小程序ID',
`item` tinyint(4) NOT NULL DEFAULT '0' COMMENT '跳转类型',
`link` text COMMENT '跳转数据',
`sort` int(11) NOT NULL DEFAULT '0' COMMENT '排序',
`name` varchar(50) NOT NULL COMMENT '广告标题',
`icon` varchar(255) NOT NULL COMMENT '图片',
`display` tinyint(4) NOT NULL DEFAULT '1' COMMENT '1显示,2隐藏',
`createdAt` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
`deleteAt` int(11) NOT NULL DEFAULT '0' COMMENT '删除时间',
`location` tinyint(4) NOT NULL COMMENT '1.积分商城',
`type` tinyint(4) DEFAULT '1' COMMENT '1幻灯片,2中部广告位',
`changeAt` int(11) DEFAULT '0',
PRIMARY KEY (`id`),
KEY `uniacid` (`uniacid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='广告';"
);
pdo_query("CREATE TABLE IF NOT EXISTS " . tablename('ybwm_integral_goods') . "(
`id` int(11) NOT NULL AUTO_INCREMENT,
`type` tinyint(4) NOT NULL DEFAULT '1' COMMENT '1实物,2虚拟',
`name` varchar(100) NOT NULL COMMENT '商品名称',
`stock` int(11) NOT NULL DEFAULT '0' COMMENT '库存',
`score` int(11) NOT NULL DEFAULT '0' COMMENT '所需积分',
`money` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '所需余额',
`isLimit` tinyint(4) NOT NULL DEFAULT '1' COMMENT '1限制,2不限制',
`num` int(11) NOT NULL DEFAULT '1' COMMENT '限制兑换次数',
`notice` text NOT NULL COMMENT '兑换须知',
`createdAt` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
`deleteAt` int(11) NOT NULL DEFAULT '0' COMMENT '删除时间',
`uniacid` int(11) NOT NULL DEFAULT '0' COMMENT '小程序Id',
`display` tinyint(4) NOT NULL DEFAULT '1' COMMENT '1 显示2隐藏',
`convertNum` int(11) NOT NULL DEFAULT '0' COMMENT '兑换数量',
`balance` decimal(10,2) DEFAULT '0.00' COMMENT '红包金额',
`icon` varchar(255) NOT NULL COMMENT '商品图片',
`sort` int(11) NOT NULL DEFAULT '1',
`typeId` int(11) NOT NULL DEFAULT '0' COMMENT '分类id',
`price` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '市场价',
`deliveryMoney` decimal(10,2) DEFAULT '0.00' COMMENT '配送费',
`isHot` int(11) NOT NULL DEFAULT '2' COMMENT '1热门2否',
`deliveryMode` varchar(255) DEFAULT NULL COMMENT '配送支持1快递2自提',
`changeAt` int(11) DEFAULT '0',
PRIMARY KEY (`id`),
KEY `uniacid` (`uniacid`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;"
);
pdo_query("CREATE TABLE IF NOT EXISTS " . tablename('ybwm_integral_order') . "(
`id` int(11) NOT NULL AUTO_INCREMENT,
`userId` int(11) NOT NULL COMMENT '用户ID',
`goodsId` int(11) NOT NULL COMMENT '商品ID',
`receiveName` varchar(30) NOT NULL COMMENT '收货人姓名',
`receiveTel` varchar(20) NOT NULL COMMENT '收货电话',
`receiveAddress` varchar(100) NOT NULL COMMENT '收货地址',
`goodsIcon` varchar(255) DEFAULT NULL COMMENT '商品图片',
`goodsName` varchar(50) NOT NULL COMMENT '商品名称',
`goodsType` tinyint(4) NOT NULL DEFAULT '1' COMMENT '商品类型1.实物2红包',
`convertNum` int(11) NOT NULL DEFAULT '1' COMMENT '兑换数量',
`score` int(11) NOT NULL DEFAULT '0' COMMENT '支付积分',
`money` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '支付金额',
`state` tinyint(1) NOT NULL DEFAULT '1' COMMENT '1未付款2已付款3已发货4已完成',
`logisticsName` varchar(30) NOT NULL COMMENT '物流名称',
`logisticsCode` varchar(50) NOT NULL COMMENT '物流单号',
`outTradeNo` varchar(50) NOT NULL COMMENT '订单号',
`createdAt` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
`userDeleteAt` int(11) DEFAULT '0' COMMENT '用户删除时间',
`deleteAt` int(11) DEFAULT '0' COMMENT '删除时间',
`uniacid` int(11) NOT NULL DEFAULT '0' COMMENT '小程序ID',
`deliverAt` int(11) NOT NULL DEFAULT '0' COMMENT '发货时间',
`deliveryMode` int(11) NOT NULL DEFAULT '1' COMMENT '1快递2自提',
`payAt` int(11) NOT NULL DEFAULT '0',
`goodsMoney` decimal(10,2) DEFAULT NULL COMMENT '红包金额',
`payMode` int(11) NOT NULL DEFAULT '1' COMMENT '付款方式 1微信支付2支付宝支付3.百度支付4.公众号支付5.余额支付',
`selfId` int(11) NOT NULL DEFAULT '0',
`deliveryMoney` decimal(10,2) DEFAULT NULL COMMENT '配送费',
`price` decimal(10,2) DEFAULT NULL COMMENT '市场价',
`selfCode` varchar(20) DEFAULT NULL COMMENT '自提码',
`note` varchar(100) DEFAULT NULL COMMENT '备注',
`transaction_id` varchar(100) NOT NULL,
`subMchId` varchar(50) DEFAULT NULL,
`completeAt` int(11) DEFAULT '0' COMMENT '完成时间',
PRIMARY KEY (`id`),
KEY `uniacid` (`uniacid`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;"
);
pdo_query("CREATE TABLE IF NOT EXISTS " . tablename('ybwm_mention_point') . "(
`id` int(10) NOT NULL AUTO_INCREMENT,
`name` varchar(50) DEFAULT NULL,
`address` varchar(255) DEFAULT NULL,
`lat` varchar(255) DEFAULT NULL,
`lng` varchar(255) DEFAULT NULL,
`display` int(11) DEFAULT '1' COMMENT '1显示2隐藏',
`createdAt` int(11) DEFAULT '0' COMMENT '添加时间',
`uniacid` int(11) DEFAULT '0',
`deleteAt` int(11) DEFAULT '0',
`tel` varchar(25) DEFAULT NULL COMMENT '联系电话',
`changeAt` int(11) DEFAULT '0',
`linkMan` varchar(20) DEFAULT NULL COMMENT '联系人',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='自提地址';"
);
/////2020-10-31
pdo_query("CREATE TABLE IF NOT EXISTS " . tablename('ybwm_new') . "(
`id` int(10) NOT NULL AUTO_INCREMENT,
`name` varchar(20) DEFAULT NULL COMMENT '活动名称',
`startTime` int(11) DEFAULT NULL,
`endTime` int(11) DEFAULT NULL,
`people` int(11) DEFAULT '1' COMMENT '1全部',
`isBalance` int(11) DEFAULT '2' COMMENT '赠送余额1开启2关闭',
`balance` decimal(10,2) DEFAULT '0.00' COMMENT '余额',
`isIntegral` int(11) DEFAULT '2' COMMENT '赠送积分1开启2关闭',
`integral` int(11) DEFAULT '0' COMMENT '赠送积分',
`isGrowth` int(11) DEFAULT '2' COMMENT '赠送成长值 1开启2关闭',
`growth` int(11) DEFAULT '0',
`isCoupon` int(11) DEFAULT '2' COMMENT '赠送优惠券1开启2关闭',
`coupon` varchar(255) DEFAULT NULL COMMENT '优惠券',
`createdAt` int(11) DEFAULT '0',
`changeAt` int(11) DEFAULT '0',
`deleteAt` int(11) DEFAULT '0',
`display` int(11) DEFAULT '1',
`uniacid` int(11) DEFAULT '0',
`icon` varchar(255) DEFAULT NULL COMMENT '背景图片',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='新客专享';"
);
pdo_query("CREATE TABLE IF NOT EXISTS " . tablename('ybwm_new_record') . "(
`id` int(10) NOT NULL AUTO_INCREMENT,
`userId` int(11) DEFAULT NULL,
`newId` int(11) DEFAULT NULL,
`balance` decimal(10,2) DEFAULT '0.00' COMMENT '赠送余额',
`integral` int(11) DEFAULT '0' COMMENT '赠送积分',
`growth` int(11) DEFAULT '0' COMMENT '赠送成长值',
`coupon` varchar(255) DEFAULT NULL COMMENT '赠送优惠券',
`createdAt` int(11) DEFAULT '0',
`uniacid` int(11) DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='新客专享领取表';"
);
pdo_query("CREATE TABLE IF NOT EXISTS " . tablename('ybwm_order_grant_coupon') . "(
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(20) DEFAULT NULL COMMENT '活动名称',
`startTime` int(11) DEFAULT NULL,
`endTime` int(11) DEFAULT NULL,
`money` decimal(10,2) DEFAULT NULL,
`fullMoney` decimal(10,2) DEFAULT NULL,
`timeType` int(11) DEFAULT '1' COMMENT '1.固定日期2领券后几日有效',
`isNextDay` int(11) DEFAULT '2' COMMENT '1次日起',
`day` int(11) DEFAULT '1' COMMENT '几日有效',
`useEndTime` int(11) DEFAULT NULL COMMENT '使用结束时间',
`useStartTime` int(11) DEFAULT '0' COMMENT '使用开始时间',
`storeType` int(11) DEFAULT '1' COMMENT '1.本店可用2全店通用3.指定门店',
`storeArr` varchar(255) DEFAULT NULL COMMENT '指定门店数组',
`people` int(11) DEFAULT '1' COMMENT '1.全部2会员3标签',
`userLabel` varchar(255) DEFAULT NULL COMMENT '标签数组',
`limitType` int(11) DEFAULT '1' COMMENT '1不限次数2每天限领',
`maxNum` int(11) DEFAULT '1' COMMENT '每日限领',
`grantNum` int(11) DEFAULT '1' COMMENT '发放数量',
`orderMoney` decimal(10,2) DEFAULT '0.00' COMMENT '订单满多少可领',
`createdAt` int(11) DEFAULT '0',
`changeAt` int(11) DEFAULT '0',
`deleteAt` int(11) DEFAULT '0',
`display` int(11) DEFAULT '1',
`uniacid` int(11) DEFAULT '0',
`storeId` int(11) DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='下单返红包';"
);
if (!pdo_fieldexists(tablename('ybwm_takeout_order'), 'grantCouponId')) {
pdo_query("ALTER TABLE" . tablename('ybwm_takeout_order') . " ADD `grantCouponId` int(11) DEFAULT '0' COMMENT '下单返红包活动id' ");
}
if (!pdo_fieldexists(tablename('ybwm_takeout_order'), 'grantCouponName')) {
pdo_query("ALTER TABLE" . tablename('ybwm_takeout_order') . " ADD `grantCouponName` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '下单返红包名称' ");
}
////////2020-11-03
pdo_query("CREATE TABLE IF NOT EXISTS " . tablename('ybwm_pay_politely') . "(
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(20) DEFAULT NULL,
`startTime` int(11) DEFAULT NULL,
`endTime` int(11) DEFAULT NULL,
`storeType` int(11) DEFAULT '1' COMMENT '1.本店2全店3指定',
`storeArr` varchar(255) DEFAULT NULL COMMENT '门店id数组',
`people` int(11) DEFAULT '1' COMMENT '1全部2会员3标签',
`userLabel` varchar(255) DEFAULT NULL COMMENT '用户标签',
`dayNum` int(11) DEFAULT '0' COMMENT '每日发放数量',
`limitType` int(11) DEFAULT '1' COMMENT '每天限领次数1不限2每天限领',
`maxNum` int(11) DEFAULT '1' COMMENT '每天限领',
`orderMoney` decimal(10,2) DEFAULT '0.00' COMMENT '订单满',
`isCoupon` int(11) DEFAULT '2' COMMENT '赠送优惠券1开启2关闭',
`couponId` varchar(100) DEFAULT NULL,
`isBalance` int(11) DEFAULT '2' COMMENT '赠送余额1.开启2关闭',
`balance` decimal(10,2) DEFAULT '0.00' COMMENT '赠送余额',
`isIntegral` int(11) DEFAULT '2' COMMENT '赠送积分1开启2关闭',
`integral` int(11) DEFAULT '0' COMMENT '赠送积分',
`isGrowth` int(11) DEFAULT '2' COMMENT '赠送成长值1开启2关闭',
`growth` int(11) DEFAULT '0' COMMENT '成长值',
`createdAt` int(11) DEFAULT '0',
`changeAt` int(11) DEFAULT '0',
`deleteAt` int(11) DEFAULT '0',
`display` int(11) DEFAULT '1' COMMENT '1显示2隐藏',
`uniacid` int(11) DEFAULT '0',
`storeId` int(11) DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='支付有礼';"
);
pdo_query("CREATE TABLE IF NOT EXISTS " . tablename('ybwm_pay_politely_record') . "(
`id` int(11) NOT NULL AUTO_INCREMENT,
`userId` int(11) DEFAULT NULL,
`orderId` int(11) DEFAULT '0' COMMENT '订单id',
`politelyId` int(11) DEFAULT '0',
`balance` decimal(10,2) DEFAULT NULL,
`integral` int(11) DEFAULT '0',
`growth` int(11) DEFAULT '0',
`coupon` varchar(255) DEFAULT NULL,
`createdAt` int(11) DEFAULT '0',
`uniacid` int(11) DEFAULT '0',
`state` int(11) DEFAULT '2' COMMENT '1.已发放2未发放',
`type` int(11) DEFAULT '1' COMMENT '1外卖',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='支付有礼领取表';"
);
if (!pdo_fieldexists(tablename('ybwm_user_integral'), 'newUser')) {
pdo_query("ALTER TABLE" . tablename('ybwm_user_integral') . " ADD `newUser` int(11) DEFAULT '0' COMMENT '新增用户是新增的就是1不是就是0' ");
}
if (!pdo_fieldexists(tablename('ybwm_nav'), 'icon')) {
pdo_query("ALTER TABLE" . tablename('ybwm_nav') . " ADD `icon` varchar(255) DEFAULT NULL ");
}
if (!pdo_fieldexists(tablename('ybwm_nav'), 'hot')) {
pdo_query("ALTER TABLE" . tablename('ybwm_nav') . " ADD `hot` varchar(255) DEFAULT '0' ");
}
if (!pdo_fieldexists(tablename('ybwm_nav'), 'sort')) {
pdo_query("ALTER TABLE" . tablename('ybwm_nav') . " ADD `sort` int(11) DEFAULT '0' ");
}
pdo_query("ALTER TABLE " . tablename('ybwm_nav') . " CHANGE `pid` `pid` int(11) DEFAULT NULL;");
pdo_delete('ybwm_nav');
pdo_query("INSERT INTO ". tablename('ybwm_nav')." (`id`, `c_name`, `a_name`, `nav_name`, `pid`, `status`, `dt_operdate`, `item`, `icon`, `hot`, `sort`) VALUES
('1', '/', '', '首页', '0', '1', '2020-09-15 10:08:57', '1', 'iconshouye', null, '1'),
('2', 'orderprocessing', null, '外卖', '0', '1', '2020-09-15 10:08:57', '1', 'iconwaimai', null, '2'),
('3', 'good', null, '商品', '0', '1', '2020-09-15 10:08:57', '1', 'iconshangpin', null, '4'),
('4', 'usersurvey', null, '用户', '0', '1', '2020-09-15 10:08:57', '1', 'iconkehu', null, '5'),
('5', 'assetssurvey', null, '财务', '0', '1', '2020-09-15 10:08:57', '1', 'iconcaiwu', null, '6'),
('6', 'renovationindex', null, '装修', '0', '1', '2020-09-15 10:08:57', '1', 'iconshanghu1', null, '7'),
('7', 'outsurvey1', null, '数据', '0', '1', '2020-09-15 10:08:57', '1', 'iconshuju', null, '8'),
('8', 'application', null, '应用', '0', '1', '2020-09-15 10:08:57', '1', 'iconyingyong', null, '9'),
('9', 'baseset', null, '设置', '0', '1', '2020-09-15 10:08:57', '1', 'iconshezhi', null, '10'),
('10', 'appletlist', null, '权限', '0', '1', '2020-09-15 10:08:57', '1', 'iconquanxian', null, '11'),
('11', 'storesurvey', '', '商户概况', '1', '1', '2020-09-15 10:08:57', '2', 'iconshanghuchaxunsvg', null, '12'),
('12', 'storeinformation', null, '商户信息', '1', '1', '2020-09-15 10:08:57', '2', 'iconshanghuruwangsvg', null, '13'),
('13', 'orderprocessing', null, '订单处理', '2', '1', '2020-09-15 10:08:57', '2', 'icondingdan', '', null),
('14', 'ordertixing', null, '订单提醒', '2', '1', '2020-09-15 10:08:57', '2', 'icontixing', null, null),
('15', 'outset', null, '外卖设置', '2', '1', '2020-09-15 10:08:57', '2', 'iconwaimaidingdan0101', null, null),
('16', 'distributionset', null, '配送设置', '2', '1', '2020-09-15 10:08:57', '2', 'iconditu', null, null),
('17', 'orderprocessing', null, '订单处理', '13', '1', '2020-09-15 10:08:57', '3', null, 'true', null),
('18', 'orderinquiry', null, '订单查询', '13', '1', '2020-09-15 10:08:57', '3', '', null, null),
('19', 'selforder', null, '自提订单', '13', '1', '2020-09-15 10:08:57', '3', null, null, null),
('20', 'templatemsg', null, '模板消息', '14', '1', '2020-09-15 10:08:57', '3', null, null, null),
('21', 'smsreminder', null, '短信消息', '14', '1', '2020-09-15 10:08:57', '3', null, null, null),
('22', 'printerset', null, '打印机管理', '14', '1', '2020-09-15 10:08:57', '3', null, null, null),
('23', 'voicereminder', null, '语音提醒', '14', '1', '2020-09-15 10:08:57', '3', null, null, null),
('24', 'citydistribution', null, '同城配送', '16', '1', '2020-09-15 10:08:57', '3', null, null, null),
('25', 'regiondistribution', null, '配送区域', '16', '1', '2020-09-15 10:08:57', '3', null, null, null),
('26', 'managegood', null, '外卖商品', '3', '1', '2020-09-15 10:08:57', '2', 'iconshangpin1', '1', null),
('27', 'spreadgood', null, '商品扩展', '3', '1', '2020-09-15 10:08:57', '2', 'iconfenlei', null, '3'),
('28', 'goodimport', null, '快速导入', '3', '1', '2020-09-15 10:08:57', '2', 'icondaoru', null, '4'),
('29', 'good', null, '商品管理', '26', '1', '2020-09-15 10:08:57', '3', null, null, null),
('30', 'goodclassify', null, '分类管理', '26', '1', '2020-09-15 10:08:57', '3', null, null, null),
('31', 'goodspec', null, '规格库', '27', '1', '2020-09-15 10:08:57', '3', null, null, null),
('32', 'goodattribute', null, '属性库', '27', '1', '2020-09-15 10:08:57', '3', null, null, null),
('33', 'goodfeeding', null, '加料库', '27', '1', '2020-09-15 10:08:57', '3', null, null, null),
('34', 'goodunit', null, '单位库', '27', '1', '2020-09-15 10:08:57', '3', null, null, null),
('35', 'goodlabel', null, '商品标签', '27', '1', '2020-09-15 10:08:57', '3', null, null, null),
('36', 'printlabel', null, '打印标签', '27', '1', '2020-09-15 10:08:57', '3', null, null, null),
('37', 'usersurvey', null, '用户概况', '4', '1', '2020-09-15 10:08:57', '2', 'icontongji', null, null),
('38', 'managemember', null, '用户管理', '4', '1', '2020-09-15 10:08:57', '2', 'iconyonghu1', null, null),
('39', 'userset', null, '用户设置', '4', '1', '2020-09-15 10:08:57', '2', 'iconyonghushezhi-', null, null),
('40', 'userquery', null, '用户查询', '38', '1', '2020-09-15 10:08:57', '3', null, null, null),
('41', 'userimport', null, '用户导入', '38', '0', '2020-09-15 10:08:57', '3', null, null, null),
('42', 'userlabel', null, '标签管理', '38', '1', '2020-09-15 10:08:57', '3', null, null, null),
('43', 'assetssurvey', null, '资产总览', '5', '1', '2020-09-15 10:08:57', '2', 'iconcaiwu1', null, null),
('44', 'shopfinance', null, '门店财务', '5', '1', '2020-09-15 10:08:57', '2', 'iconcedaohang-caiwuguanl', null, null),
('45', 'accountmange', null, '账户管理', '44', '1', '2020-09-15 10:08:57', '3', null, null, null),
('46', 'financerecord', null, '财务对账', '44', '1', '2020-09-15 10:08:57', '3', null, null, null),
('47', 'datasurvey', null, '数据概况', '7', '0', '2020-09-15 10:08:57', '2', 'iconkuaijianliuliang', null, null),
('48', 'realtime', null, '实时分析', '7', '1', '2020-09-15 10:08:57', '2', 'iconkuaijianliuliang', null, null),
('49', 'flowanalysis', null, '流量分析', '7', '0', '2020-09-15 10:08:57', '2', 'iconliuliang', null, null),
('50', 'outgood', null, '商品分析', '7', '0', '2020-09-15 10:08:57', '2', 'iconliulanqi', null, null),
('51', 'transactionanalysis', null, '交易分析', '7', '0', '2020-09-15 10:08:57', '2', 'iconjiaoyisuo', null, null),
('52', 'application', null, '应用列表', '8', '1', '2020-09-15 10:08:57', '2', 'iconyingyong1', null, null),
('53', 'baseset', null, '基础设置', '9', '1', '2020-09-15 10:08:57', '2', 'iconshezhi2', null, null),
('54', 'orderset', null, '通用设置', '9', '1', '2020-09-15 10:08:57', '2', 'iconshezhi1', null, null),
('55', 'ordertixing', null, '订单提醒', '9', '1', '2020-09-15 10:08:57', '2', 'icon10', null, null),
('56', 'paymentset', null, '支付设置', '9', '1', '2020-09-15 10:08:57', '2', 'iconzhifu', null, null),
('57', 'distributionset', null, '配送设置', '9', '2', '2020-09-15 10:08:57', '2', 'iconwaimai', null, null),
('58', 'otherset', null, '其他设置', '9', '1', '2020-09-15 10:08:57', '2', 'iconqita', null, null),
('59', 'authrole', null, '员工管理', '9', '1', '2020-09-15 10:08:57', '2', 'iconquanxianshenyue', null, null),
('60', 'orderremind', null, '短信设置', '55', '1', '2020-09-15 10:08:57', '3', null, null, null),
('61', 'ptmsg', null, '模板消息', '55', '1', '2020-09-15 10:08:57', '3', null, null, null),
('62', 'ptprentset', null, '打印设置', '55', '1', '2020-09-15 10:08:57', '3', null, null, null),
('63', 'ptautiomsg', null, '语音提醒', '55', '0', '2020-09-15 10:08:57', '3', null, null, null),
('64', 'otherset', null, '帮助中心', '58', '1', '2020-09-15 10:08:57', '3', null, null, null),
('65', 'noticeset', null, '公告管理', '58', '1', '2020-09-15 10:08:57', '3', null, null, null),
('66', 'shopservice', null, '店铺服务', '58', '0', '2020-09-15 10:08:57', '3', null, null, null),
('67', 'infoset', null, '资讯管理', '58', '1', '2020-09-15 10:08:57', '3', null, null, null),
('68', 'enclosure', null, '远程附件', '58', '1', '2020-09-15 10:08:57', '3', null, null, null),
('69', 'manager', null, '员工列表', '59', '1', '2020-09-15 10:08:57', '3', null, null, null),
('70', 'role', null, '角色管理', '59', '1', '2020-09-15 10:08:57', '3', null, null, null),
('71', 'warrant', null, '网站授权', '10', '1', '2020-09-15 10:08:57', '2', 'iconjiaoseshouquan', null, null),
('72', 'other', null, '超级权限', '10', '1', '2020-09-15 10:08:57', '2', 'iconqita', null, null),
('73', 'changelog', null, '更新记录', '71', '1', '2020-09-15 10:08:57', '3', null, null, null),
('74', 'empower', null, '授权详情', '71', '1', '2020-09-15 10:08:57', '3', null, null, null),
('75', 'founder', null, '超级权限', '72', '1', '2020-09-15 10:08:57', '3', null, null, null),
('76', 'cacheset', null, '缓存设置', '72', '1', '2020-09-15 10:08:57', '3', null, null, null),
('77', 'appletlist', null, '小程序列表', '10', '1', '2020-09-15 10:08:57', '2', 'iconxiaochengxushezhi', null, null),
('78', 'storemanage', null, '店铺管理', '6', '1', '2020-09-15 10:08:57', '2', 'iconzhuangxiudianpu', null, null),
('79', 'other', null, '其他', '6', '1', '2020-09-15 10:08:57', '2', 'iconicon_xinyong_xianxing_jijin-', null, null),
('80', 'renovationindex', null, '装修列表', '78', '1', '2020-09-15 10:08:57', '3', null, null, null),
('81', 'storestyle', null, '全店风格', '78', '1', '2020-09-15 10:08:57', '3', null, null, null),
('82', 'storetemment', null, '点单风格', '78', '1', '2020-09-15 10:08:57', '3', null, null, null),
('83', 'materialmange', null, '素材管理', '79', '1', '2020-09-15 10:08:57', '3', null, null, null),
('84', 'pagetitle', null, '页面标题', '58', '1', '2020-09-15 10:08:57', '3', null, null, null),
('85', 'shopsurvey', null, '门店', '0', '1', '2020-09-15 10:08:57', '1', 'iconmendian', '', '7'),
('87', 'withdrawalliest', null, '提现申请', '85', '1', '2020-09-15 10:08:57', '2', 'icontixian', '', '3'),
('88', 'shopclassify', null, '门店类别', '85', '1', '2020-09-15 10:08:57', '2', 'iconleimupinleifenleileibie2', '', '4'),
('89', 'shopset', null, '门店设置', '85', '1', '2020-09-15 10:08:57', '2', 'iconshezhi3', '', '5'),
('90', 'shopsurvey', null, '门店概况', '85', '1', '2020-09-15 10:08:57', '2', 'icongaikuang', '', '1'),
('91', 'shoplist', null, '门店列表', '85', '1', '2020-09-15 10:08:57', '2', 'iconchazhaobiaodanliebiao', '', '2'),
('92', 'withdrawalliest', null, '提现列表', '87', '1', '2020-09-15 10:08:57', '3', null, '', null),
('93', 'servicerate', null, '服务费率', '87', '1', '2020-09-15 10:08:57', '3', null, '', null),
('94', 'withdrawallset', null, '提现设置', '87', '1', '2020-09-15 10:08:57', '3', null, '', null),
('95', 'shopclassify', null, '门店分组', '88', '1', '2020-09-15 10:08:57', '3', null, '', null),
('96', 'shopregion', null, '门店区域', '88', '1', '2020-09-15 10:08:57', '3', null, '', null),
('97', 'shoplabel', null, '门店标签', '88', '1', '2020-09-15 10:08:57', '3', null, '', null),
('98', 'elemorder', null, '饿了么订单', '13', '1', '2020-12-12 10:08:19', '3', null, '', null),
('99', 'meituanorder', null, '美团订单', '13', '1', '2020-12-14 10:53:48', '3', null, '', '1'),
('100', 'instoresurvey', null, '店内', '0', '1', '2020-12-29 16:50:54', '1', 'icondiancan-copy', '', '3'),
('101', 'instoresurvey', null, '堂食概况', '100', '1', null, '2', 'icongaikuang1', '', null),
('102', 'instoreorder', null, '订单管理', '100', '1', null, '2', 'iconicon-', '', null),
('103', 'instoreorder', null, '堂食订单', '102', '1', null, '3', null, '', null),
('104', 'infastorder', null, '快餐订单', '102', '1', null, '3', null, '', null),
('105', 'cashierorder', null, '当面付订单', '13', '1', null, '3', null, '', '0'),
('106', 'appointmentstore', null, '预约订单', '102', '0', null, '3', null, '', null),
('107', 'table', null, '桌码管理', '100', '1', null, '2', 'icondiandan', '', null),
('109', 'tablemanager', null, '活码管理', '107', '0', null, '3', null, '', null),
('110', 'ingoodlist', null, '店内商品', '3', '1', null, '2', 'iconshangpin2', '', '2'),
('111', 'ingoodlist', null, '商品管理', '110', '1', null, '3', null, '', null),
('112', 'ingoodclassify', null, '分类管理', '110', '1', null, '3', null, '', null),
('113', 'instoreset', null, '店内设置', '100', '1', null, '2', 'iconshezhi4', '', null),
('114', 'inprinterset', null, '打印机管理', '100', '1', null, '2', 'iconicon_xinyong_xianxing_jijin-', '', null),
('115', 'tablecode', null, '门店码', '107', '0', null, '3', null, '', null),
('116', 'balance', null, '余额明细', '5', '0', null, '2', 'iconcedaohang-caiwuguanl', '', null),
('117', 'integralflow', null, '积分明细', '5', '0', null, '2', 'iconcedaohang-caiwuguanl', '', null),
('118', 'balance', null, '余额流水', '134', '1', null, '3', '', '', null),
('119', 'integralflow', null, '积分流水', '134', '1', null, '3', '', '', null),
('120', 'vipmange', null, '会员管理', '4', '1', null, '2', 'iconyonghu1', '0', null),
('121', 'vipsurvey', null, '会员卡概况', '120', '0', null, '3', null, '0', null),
('122', 'vipmange', null, '会员卡等级', '120', '1', null, '3', null, '0', null),
('123', 'vipquery', null, '开卡记录', '120', '1', null, '3', null, '0', null),
('124', 'vipset', null, '会员卡设置', '120', '1', null, '3', null, '0', null),
('125', 'outsurvey', null, '外卖概况', '7', '1', null, '2', 'iconleimupinleifenleileibie2', '0', null),
('126', 'outsurvey1', null, '订单概况', '125', '1', null, '3', null, '0', null),
('127', 'outsurvey2', null, '支付概况', '125', '1', null, '3', null, '0', null),
('128', 'outsurvey3', null, '商品概况', '125', '1', null, '3', null, '0', null),
('129', 'insurvey', null, '店内概况', '7', '1', null, '2', 'icongaikuang1', '0', null),
('130', 'insurvey1', null, '订单概况', '129', '1', null, '3', null, '0', null),
('131', 'insurvey2', null, '支付概况', '129', '1', null, '3', null, '0', null),
('132', 'insurvey3', null, '商品概况', '129', '1', null, '3', null, '0', null),
('133', 'flowanalysis', null, '当面付概况', '7', '1', null, '2', 'iconliuliang', '0', null),
('134', 'balance', null, '财务管理', '4', '1', null, '2', 'iconcedaohang-caiwuguanl', '0', null),
('135', 'transactiondl', null, '交易记录', '5', '1', null, '2', 'iconliuliang', '0', null),
('136', 'merchantset', null, '商家端设置', '10', '1', null, '2', 'iconxiaochengxushezhi', '0', null),
('137', 'evaluate', null, '评价管理', '13', '1', null, '3', null, '0', 1);
");
if (!pdo_fieldexists(tablename('ybwm_users'), 'type')) {
pdo_query("ALTER TABLE" . tablename('ybwm_users') . " ADD `type` tinyint(1) DEFAULT '2' COMMENT '1平台管理员2普通管理员' ");
}
///////2020-11-04
if (!pdo_fieldexists(tablename('ybwm_takeout_order'), 'platformCouponPreferential')) {
pdo_query("ALTER TABLE" . tablename('ybwm_takeout_order') . " ADD `platformCouponPreferential` decimal(10,2) DEFAULT NULL ");
}
pdo_query("ALTER TABLE " . tablename('ybwm_takeout_order') . " CHANGE `couponId` `couponId` varchar(255) DEFAULT NULL;");
pdo_query("CREATE TABLE IF NOT EXISTS " . tablename('ybwm_live') . "(
`id` int(11) NOT NULL AUTO_INCREMENT,
`anchor_name` varchar(100) NOT NULL,
`cover_img` varchar(255) NOT NULL,
`end_time` varchar(20) NOT NULL,
`goods` varchar(255) NOT NULL,
`live_status` int(11) NOT NULL,
`name` varchar(100) NOT NULL,
`roomid` int(11) NOT NULL,
`share_img` varchar(255) NOT NULL,
`start_time` varchar(20) NOT NULL,
`uniacid` int(11) NOT NULL,
PRIMARY KEY (`id`),
KEY `uniacid` (`uniacid`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='直播表';"
);
pdo_query("CREATE TABLE IF NOT EXISTS " . tablename('ybwm_live_goods') . "(
`id` int(11) NOT NULL AUTO_INCREMENT,
`goodsId` int(11) NOT NULL,
`goodsIdStr` varchar(100) NOT NULL,
`name` varchar(100) NOT NULL,
`onShelves` int(11) NOT NULL,
`price` varchar(10) NOT NULL,
`price2` varchar(10) NOT NULL,
`priceType` int(11) NOT NULL,
`smallStoreGoodSoure` varchar(10) NOT NULL,
`thirdPartyAppid` varchar(32) NOT NULL,
`thirdPartyTag` varchar(10) NOT NULL,
`url` varchar(255) NOT NULL,
`vendorGoodsKey` varchar(255) NOT NULL,
`coverImgUrl` varchar(255) NOT NULL,
`status` int(11) NOT NULL,
`uniacid` int(11) NOT NULL,
PRIMARY KEY (`id`),
KEY `uniacid` (`uniacid`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='直播商品表';"
);
if (!pdo_fieldexists(tablename('ybwm_store'), 'storeNumber')) {
pdo_query("ALTER TABLE" . tablename('ybwm_store') . " ADD `storeNumber` varchar(20) DEFAULT NULL COMMENT '门店编号' ");
}
if (!pdo_fieldexists(tablename('ybwm_users'), 'trueName')) {
pdo_query("ALTER TABLE" . tablename('ybwm_users') . " ADD `trueName` varchar(50) DEFAULT NULL ");
}
//////2020-11-06
if (!pdo_fieldexists(tablename('ybwm_information'), 'views')) {
pdo_query("ALTER TABLE" . tablename('ybwm_information') . " ADD `views` int(11) DEFAULT '0' COMMENT '浏览量'");
}
if (!pdo_fieldexists(tablename('ybwm_information'), 'storeId')) {
pdo_query("ALTER TABLE" . tablename('ybwm_information') . " ADD `storeId` int(11) DEFAULT '0'");
}
if (!pdo_fieldexists(tablename('ybwm_information'), 'icon')) {
pdo_query("ALTER TABLE" . tablename('ybwm_information') . " ADD `icon` varchar(255) DEFAULT NULL COMMENT '缩略图'");
}
pdo_query("CREATE TABLE IF NOT EXISTS " . tablename('ybwm_collection_courtesy') . "(
`id` int(11) NOT NULL AUTO_INCREMENT,
`userId` int(11) DEFAULT NULL,
`media` varchar(255) DEFAULT NULL,
`state` int(11) DEFAULT '1' COMMENT '1待审核2已通过3已拒绝',
`createdAt` int(11) DEFAULT NULL,
`changeAt` int(11) DEFAULT NULL,
`uniacid` int(11) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='收藏有礼';"
);
/////////2020-11-10
pdo_query("CREATE TABLE IF NOT EXISTS " . tablename('ybwm_change_pay') . "(
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(20) DEFAULT NULL,
`startTime` int(11) DEFAULT '0',
`endTime` int(11) DEFAULT '0',
`money` decimal(10,2) DEFAULT '0.00' COMMENT '换购价',
`stock` varchar(255) DEFAULT NULL,
`storeType` int(11) DEFAULT '1' COMMENT '1.本店2全店3指定',
`storeArr` varchar(500) DEFAULT NULL COMMENT '门店数组',
`limitType` int(11) DEFAULT '1' COMMENT '1不限次数2每天换购',
`num` int(11) DEFAULT '1' COMMENT '每天换购多少次',
`goodsArr` text COMMENT '商品数组',
`createdAt` int(11) DEFAULT '0',
`changeAt` int(11) DEFAULT '0',
`deleteAt` int(11) DEFAULT '0',
`display` int(11) DEFAULT '1' COMMENT '1显示2隐藏',
`uniacid` int(11) DEFAULT '0',
`storeId` int(11) DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;"
);
if (!pdo_fieldexists(tablename('ybwm_order_goods'), 'isChange')) {
pdo_query("ALTER TABLE" . tablename('ybwm_order_goods') . " ADD `isChange` int(11) DEFAULT '2' COMMENT '换购 1.是2不是' ");
}
if (!pdo_fieldexists(tablename('ybwm_takeout_order'), 'changeId')) {
pdo_query("ALTER TABLE" . tablename('ybwm_takeout_order') . " ADD `changeId` int(11) DEFAULT '0' COMMENT '换购活动id' ");
}
////////////2020-11-11
pdo_query("CREATE TABLE IF NOT EXISTS " . tablename('ybwm_birthday') . "(
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(20) DEFAULT NULL COMMENT '活动标题',
`startTime` int(11) DEFAULT NULL COMMENT '开始时间',
`endTime` int(11) DEFAULT NULL COMMENT '结束时间',
`people` int(11) DEFAULT '1' COMMENT '1全部2新用户3会员4.指定等级会员5.指定标签会员',
`userLabel` varchar(255) DEFAULT NULL COMMENT '标签id',
`rankId` int(11) DEFAULT NULL COMMENT '等级id',
`day` int(11) DEFAULT '0' COMMENT '几天前',
`smsOpen` int(11) DEFAULT '2' COMMENT '1开启2关闭',
`isBalance` int(11) DEFAULT '2' COMMENT '赠送余额1开启2关闭',
`balance` decimal(10,2) DEFAULT '0.00',
`isIntegral` int(11) DEFAULT '2' COMMENT '赠送积分1开启2关闭',
`integral` int(11) DEFAULT '0',
`isGrowth` int(11) DEFAULT '2' COMMENT '赠送成长值1开启2关闭',
`growth` int(11) DEFAULT '0',
`isCoupon` int(11) DEFAULT '2' COMMENT '赠送优惠券1开启2关闭',
`coupon` varchar(225) DEFAULT NULL COMMENT '优惠券',
`display` int(11) DEFAULT '1' COMMENT '1开启2关闭',
`deleteAt` int(11) DEFAULT '0' COMMENT '删除时间',
`createdAt` int(11) DEFAULT '0' COMMENT '创建时间',
`changeAt` int(11) DEFAULT '0',
`uniacid` int(11) DEFAULT NULL COMMENT '小程序id',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;"
);
pdo_query("CREATE TABLE IF NOT EXISTS " . tablename('ybwm_grant_coupon_receive') . "(
`id` int(11) NOT NULL AUTO_INCREMENT,
`userId` int(11) NOT NULL,
`grantId` int(11) NOT NULL COMMENT '发券活动id',
`createdAt` int(11) NOT NULL COMMENT '领取时间',
`uniacid` int(11) NOT NULL,
`activityType` int(11) DEFAULT '1' COMMENT '1.发券宝2生日有礼',
`state` int(11) DEFAULT '2' COMMENT '1已弹2未弹',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;"
);
pdo_query("CREATE TABLE IF NOT EXISTS " . tablename('ybwm_window_coupon') . "(
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(20) DEFAULT NULL,
`startTime` int(11) DEFAULT NULL,
`endTime` int(11) DEFAULT NULL,
`location` int(11) DEFAULT '1' COMMENT '1外卖点单页2堂食点单页',
`coupon` text COMMENT '优惠券数组',
`icon` varchar(255) DEFAULT NULL COMMENT '背景图片',
`createdAt` int(11) DEFAULT '0',
`changeAt` int(11) DEFAULT '0',
`deleteAt` int(11) DEFAULT '0',
`uniacid` int(11) DEFAULT '0',
`display` int(11) DEFAULT '1' COMMENT '1显示2隐藏',
`storeId` int(11) DEFAULT '0',
`people` int(11) DEFAULT '1' COMMENT '1.全部2新用户3老用户',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;"
);
pdo_query("CREATE TABLE IF NOT EXISTS " . tablename('ybwm_window_coupon_receive') . "(
`id` int(11) NOT NULL AUTO_INCREMENT,
`windowId` int(11) DEFAULT '0',
`userId` int(11) DEFAULT '0',
`uniacid` int(11) DEFAULT '0',
`createdAt` int(11) DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;"
);
////////2020-11-19
if (!pdo_fieldexists(tablename('ybwm_member_label'), 'storeId')) {
pdo_query("ALTER TABLE" . tablename('ybwm_member_label') . " ADD `storeId` int(11) DEFAULT NULL ");
}
if (!pdo_fieldexists(tablename('ybwm_core_goods'), 'media')) {
pdo_query("ALTER TABLE" . tablename('ybwm_core_goods') . " ADD `media` text COLLATE utf8mb4_unicode_ci COMMENT '商品多图片' ");
}
if (!pdo_fieldexists(tablename('ybwm_store'), 'goodsModel')) {
pdo_query("ALTER TABLE" . tablename('ybwm_store') . " ADD `goodsModel` tinyint(1) DEFAULT '1' COMMENT '门店商品同步模式' ");
}
pdo_query("CREATE TABLE IF NOT EXISTS " . tablename('ybwm_openId') . "(
`id` int(11) NOT NULL AUTO_INCREMENT,
`storeId` int(11) DEFAULT NULL,
`openId` varchar(50) DEFAULT NULL,
`userName` varchar(30) DEFAULT NULL,
`portrait` varchar(255) DEFAULT NULL,
`createdAt` int(11) DEFAULT NULL,
`uniacid` int(11) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;"
);
pdo_query("CREATE TABLE IF NOT EXISTS " . tablename('ybwm_store_goods') . "(
`id` int(11) NOT NULL AUTO_INCREMENT,
`uniacid` int(11) NOT NULL COMMENT '小程序Id',
`storeId` int(11) NOT NULL COMMENT '门店ID',
`goodsId` int(11) NOT NULL COMMENT '商品Id',
`data` text COMMENT '库存信息',
`createdAt` int(11) DEFAULT NULL COMMENT '创建时间',
`display` tinyint(4) DEFAULT '2' COMMENT '1显示,2隐藏',
`isRecommend` tinyint(2) DEFAULT '2' COMMENT '1推荐2否',
`salesNum` int(11) DEFAULT '0' COMMENT '销量',
`price` decimal(10,2) DEFAULT NULL,
`maxPrice` decimal(10,2) DEFAULT NULL,
`isSpecs` tinyint(1) DEFAULT NULL,
`stock` int(11) DEFAULT '0',
PRIMARY KEY (`id`),
KEY `uniacid` (`uniacid`),
KEY `storeId` (`storeId`),
KEY `goodsId` (`goodsId`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;"
);
if (!pdo_fieldexists(tablename('ybwm_notice'), 'storeId')) {
pdo_query("ALTER TABLE" . tablename('ybwm_notice') . " ADD `storeId` int(11) DEFAULT NULL ");
}
///////2020-11-20
if (!pdo_fieldexists(tablename('ybwm_role_list'), 'changeAt')) {
pdo_query("ALTER TABLE" . tablename('ybwm_role_list') . " ADD `changeAt` int(11) DEFAULT NULL ");
}
///////2020-11-21
pdo_query("CREATE TABLE IF NOT EXISTS " . tablename('ybwm_user_collection') . "(
`id` int(11) NOT NULL AUTO_INCREMENT,
`userId` int(11) DEFAULT NULL,
`collectionId` int(11) DEFAULT '0' COMMENT '收藏信息id',
`type` int(11) DEFAULT '1' COMMENT '1商家',
`state` int(11) DEFAULT '1' COMMENT '1已收藏2未收藏',
`createdAt` int(11) DEFAULT '0',
`changeAt` int(11) DEFAULT '0',
`uniacid` int(11) DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;"
);
if (!pdo_fieldexists(tablename('ybwm_member'), 'browseStoreId')) {
pdo_query("ALTER TABLE" . tablename('ybwm_member') . " ADD `browseStoreId` int(11) DEFAULT '0' COMMENT '上次浏览的店铺' ");
}
////////2020-11-23
if (!pdo_fieldexists(tablename('ybwm_takeout_order'), 'isRemind')) {
pdo_query("ALTER TABLE" . tablename('ybwm_takeout_order') . " ADD `isRemind` int(11) DEFAULT '1' COMMENT '1.提醒了2未提醒 取餐提醒' ");
}
pdo_query("CREATE TABLE IF NOT EXISTS " . tablename('ybwm_issue_coupons') . "(
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(20) DEFAULT NULL,
`startTime` int(11) DEFAULT NULL,
`endTime` int(11) DEFAULT NULL,
`bgImg` varchar(255) DEFAULT NULL COMMENT '背景图片',
`numType` int(11) DEFAULT '1' COMMENT '1.一次2.每月一次3.每周一次',
`people` int(11) DEFAULT '1' COMMENT '1全部2新用户3会员4指定等级5标签',
`userLabel` varchar(500) DEFAULT NULL,
`coupon` varchar(500) DEFAULT NULL,
`uniacid` int(11) DEFAULT '0',
`createdAt` int(11) DEFAULT '0',
`deleteAt` int(11) DEFAULT '0',
`display` int(11) DEFAULT '1',
`changeAt` int(11) DEFAULT '0',
`type` int(11) DEFAULT '1',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;"
);
//////2020-11-25
if (!pdo_fieldexists(tablename('ybwm_user_coupon'), 'storeId')) {
pdo_query("ALTER TABLE" . tablename('ybwm_user_coupon') . " ADD `storeId` int(11) DEFAULT '0' COMMENT '商家id' ");
}
/////2020-11-28
if (!pdo_fieldexists(tablename('ybwm_takeout_order'), 'refundType')) {
pdo_query("ALTER TABLE" . tablename('ybwm_takeout_order') . " ADD `refundType` int(11) DEFAULT '1' ");
}
pdo_query("CREATE TABLE IF NOT EXISTS " . tablename('ybwm_roll_bag') . "(
`id` int(10) NOT NULL AUTO_INCREMENT,
`name` varchar(50) DEFAULT NULL,
`startTime` int(11) DEFAULT '0',
`endTime` int(11) DEFAULT '0',
`coupon` text COMMENT '代金券数组',
`icon` varchar(255) DEFAULT NULL COMMENT '封面图',
`media` text COMMENT '详情图片',
`price` decimal(10,2) DEFAULT '0.00' COMMENT '原价',
`money` decimal(10,2) DEFAULT '0.00',
`stock` int(11) DEFAULT '0' COMMENT '库存',
`dayNum` int(11) DEFAULT '0' COMMENT '每人每日购买',
`days` int(11) DEFAULT '0' COMMENT '购买后多少天有效',
`createdAt` int(11) DEFAULT '0',
`changeAt` int(11) DEFAULT '0',
`deleteAt` int(11) DEFAULT '0',
`uniacid` int(11) DEFAULT '0',
`storeId` int(11) DEFAULT '0',
`display` int(11) DEFAULT '1' COMMENT '1.显示2隐藏',
`type` int(11) DEFAULT '1' COMMENT '1代金券',
`salesNum` int(11) DEFAULT '0' COMMENT '销量',
`couponNum` int(11) DEFAULT '0' COMMENT '优惠券数量',
`details` text,
PRIMARY KEY (`id`),
KEY `storeId` (`storeId`),
KEY `uniacid` (`uniacid`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='券包';"
);
pdo_query("CREATE TABLE IF NOT EXISTS " . tablename('ybwm_roll_bag_order') . "(
`id` int(10) NOT NULL AUTO_INCREMENT,
`bagId` int(11) DEFAULT NULL,
`userId` int(11) DEFAULT NULL,
`storeId` int(11) DEFAULT NULL,
`coupon` text,
`money` decimal(10,2) DEFAULT '0.00',
`outTradeNo` varchar(50) DEFAULT NULL COMMENT '订单号',
`state` int(11) DEFAULT '1' COMMENT '1未支付2已支付',
`days` int(11) DEFAULT '0' COMMENT '购买后多少天有效',
`createdAt` int(11) DEFAULT '0',
`changeAt` int(11) DEFAULT '0',
`deleteAt` int(11) DEFAULT '0',
`uniacid` int(11) DEFAULT '0',
`transaction_id` varchar(100) DEFAULT NULL,
`subMchId` varchar(50) DEFAULT NULL,
`payType` int(11) DEFAULT '1' COMMENT '付款模式 1普通模式,2服务商模式',
`payMode` int(11) DEFAULT '1' COMMENT '付款方式 1微信支付5余额支付',
`payAt` int(11) DEFAULT '0',
`num` int(11) DEFAULT '1' COMMENT '购买数量',
`bagIcon` varchar(255) DEFAULT NULL COMMENT '券包封面图',
`bagName` varchar(20) DEFAULT NULL COMMENT '券包活动名称',
PRIMARY KEY (`id`),
KEY `userId` (`userId`),
KEY `uniacid` (`uniacid`),
KEY `storeId` (`storeId`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='券包订单';"
);
////////2020-11-30
pdo_query("CREATE TABLE IF NOT EXISTS " . tablename('ybwm_exchange_code') . "(
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(20) DEFAULT NULL,
`startTime` int(11) DEFAULT NULL,
`endTime` int(11) DEFAULT NULL,
`stock` int(11) DEFAULT '0',
`limitType` int(11) DEFAULT '1' COMMENT '1不限制2限制',
`maxNum` int(11) DEFAULT '0' COMMENT '限制多少',
`coupon` varchar(255) DEFAULT NULL,
`code` varchar(20) DEFAULT NULL,
`createdAt` int(11) DEFAULT '0',
`changeAt` int(11) DEFAULT '0',
`deleteAt` int(11) DEFAULT '0',
`uniacid` int(11) DEFAULT '0',
`display` int(11) DEFAULT '1',
`isCoupon` int(11) DEFAULT '2' COMMENT '赠送优惠券1开启2关闭',
`storeId` int(11) DEFAULT '0',
`salesNum` int(11) DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;"
);
pdo_query("CREATE TABLE IF NOT EXISTS " . tablename('ybwm_exchange_code_record') . "(
`id` int(11) NOT NULL AUTO_INCREMENT,
`userId` int(11) DEFAULT NULL,
`codeId` int(11) DEFAULT NULL COMMENT '兑换码id',
`createdAt` int(11) DEFAULT NULL,
`uniacid` int(11) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;"
);
////////////2020-12-02
if (!pdo_fieldexists(tablename('ybwm_bill'), 'subsidy')) {
pdo_query("ALTER TABLE" . tablename('ybwm_bill') . " ADD `subsidy` decimal(10,2) DEFAULT '0.00' COMMENT '平台补贴' ");
}
if (!pdo_fieldexists(tablename('ybwm_coupon'), 'subsidy')) {
pdo_query("ALTER TABLE" . tablename('ybwm_coupon') . " ADD `subsidy` decimal(10,2) DEFAULT '0.00' COMMENT '平台补贴' ");
}
if (!pdo_fieldexists(tablename('ybwm_takeout_order'), 'subsidy')) {
pdo_query("ALTER TABLE" . tablename('ybwm_takeout_order') . " ADD `subsidy` decimal(10,2) DEFAULT '0.00' COMMENT '平台补贴' ");
}
if (!pdo_fieldexists(tablename('ybwm_user_coupon'), 'subsidy')) {
pdo_query("ALTER TABLE" . tablename('ybwm_user_coupon') . " ADD `subsidy` decimal(10,2) DEFAULT '0.00' COMMENT '平台补贴' ");
}
pdo_query("CREATE TABLE IF NOT EXISTS " . tablename('ybwm_voice_notice') . "(
`id` int(11) NOT NULL AUTO_INCREMENT,
`storeId` int(11) NOT NULL,
`type` tinyint(4) NOT NULL DEFAULT '1' COMMENT '1点单',
`message` longtext NOT NULL COMMENT '通知内容',
`display` tinyint(4) NOT NULL DEFAULT '1' COMMENT '1显示,2隐藏',
`createdAt` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
`deleteAt` int(11) NOT NULL DEFAULT '0',
`uniacid` int(11) NOT NULL DEFAULT '0' COMMENT '小程序ID',
PRIMARY KEY (`id`),
KEY `uniacid` (`uniacid`),
KEY `storeId` (`storeId`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='语音通知表';"
);
////////////2020-12-07
if (!pdo_fieldexists(tablename('ybwm_user_coupon'), 'memberType')) {
pdo_query("ALTER TABLE" . tablename('ybwm_user_coupon') . " ADD `memberType` int(11) DEFAULT '1' COMMENT '1所有人2会员3指定标签用户' ");
}
if (!pdo_fieldexists(tablename('ybwm_user_coupon'), 'memberLabel')) {
pdo_query("ALTER TABLE" . tablename('ybwm_user_coupon') . " ADD `memberLabel` varchar(255) DEFAULT NULL ");
}
///////////2020-12-08
if (!pdo_fieldexists(tablename('ybwm_core_category'), 'customName')) {
pdo_query("ALTER TABLE" . tablename('ybwm_core_category') . " ADD `customName` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '自定义属性名称' ");
}
///////2020-12-10
if (!pdo_fieldexists(tablename('ybwm_core_goods'), 'goodsPid')) {
pdo_query("ALTER TABLE" . tablename('ybwm_core_goods') . " ADD `goodsPid` int(11) DEFAULT NULL COMMENT '主门店商品Id' ");
}
///////2020-12-11
if (!pdo_fieldexists(tablename('ybwm_core_goods'), 'virtualSales')) {
pdo_query("ALTER TABLE" . tablename('ybwm_core_goods') . " ADD `virtualSales` int(11) DEFAULT '0' COMMENT '虚拟销量' ");
}
if (!pdo_fieldexists(tablename('ybwm_store'), 'eleStoreId')) {
pdo_query("ALTER TABLE" . tablename('ybwm_store') . " ADD `eleStoreId` int(11) DEFAULT '0' COMMENT '饿了么商家id' ");
}
///////2020-12-17
if (!pdo_fieldexists(tablename('ybwm_helps'), 'otherType')) {
pdo_query("ALTER TABLE" . tablename('ybwm_helps') . " ADD `otherType` tinyint(1) DEFAULT '1' ");
}
if (!pdo_fieldexists(tablename('ybwm_core_goods'), 'goodsType')) {
pdo_query("ALTER TABLE" . tablename('ybwm_core_goods') . " ADD `goodsType` tinyint(1) DEFAULT '1' COMMENT '1外卖2店内' ");
}
/////2020-12-21
pdo_query("CREATE TABLE IF NOT EXISTS " . tablename('ybwm_exchange_code_info') . "(
`id` int(11) NOT NULL AUTO_INCREMENT,
`code` varchar(100) DEFAULT NULL,
`codeId` int(11) DEFAULT '0',
`state` int(11) DEFAULT '2' COMMENT '1.核销2未核销',
`createdAt` int(11) DEFAULT '0',
`uniacid` int(11) DEFAULT '0',
`changeAt` int(11) DEFAULT '0' COMMENT '核销时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;"
);
///////2020-12-23
if (!pdo_fieldexists(tablename('ybwm_order_goods'), 'item')) {
pdo_query("ALTER TABLE" . tablename('ybwm_order_goods') . " ADD `item` int(11) DEFAULT '1' COMMENT '1外卖2店内3快餐'");
}
///////2020-12-26
pdo_query("CREATE TABLE IF NOT EXISTS " . tablename('ybwm_cashier_order') . "(
`id` int(11) NOT NULL AUTO_INCREMENT,
`userId` int(11) DEFAULT NULL,
`storeId` int(11) DEFAULT NULL,
`money` decimal(10,2) DEFAULT NULL,
`outTradeNo` varchar(100) DEFAULT NULL,
`origin` int(11) DEFAULT NULL,
`payMode` int(11) DEFAULT '1' COMMENT '付款方式 1微信支付5余额支付',
`payAt` int(11) DEFAULT NULL,
`uniacid` int(11) DEFAULT NULL,
`state` int(11) DEFAULT '1' COMMENT '1.待支付2已支付',
`userNote` varchar(50) DEFAULT NULL,
`subMchid` varchar(50) DEFAULT NULL,
`transaction_id` varchar(50) DEFAULT NULL,
`payType` int(11) DEFAULT '1' COMMENT '1普通模式,2服务商模式',
`payPort` int(11) DEFAULT '1' COMMENT '服务商支付判断1.商家服务商支付 2.平台服务商支付 ',
`profitSharing` int(11) DEFAULT '2' COMMENT '1是分账2不分账',
`profitSharingState` int(11) DEFAULT '2' COMMENT '1已分账2未分账3完结分账 ',
`createdAt` int(11) DEFAULT '0',
`changeAt` int(11) DEFAULT '0',
`deleteAt` int(11) DEFAULT '0',
PRIMARY KEY (`id`),
KEY `storeId` (`storeId`),
KEY `uniacid` (`uniacid`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;"
);
///////2020-12-29
pdo_query("CREATE TABLE IF NOT EXISTS " . tablename('ybwm_instore_order') . "(
`id` int(11) NOT NULL AUTO_INCREMENT,
`origin` int(11) DEFAULT '1' COMMENT '订单来源1微信小程序,3支付宝,4百度',
`storeId` int(11) DEFAULT '0',
`uniacid` int(11) DEFAULT '0',
`userId` int(11) DEFAULT '0',
`outTradeNo` varchar(50) DEFAULT NULL,
`money` decimal(10,2) DEFAULT '0.00',
`originMoney` decimal(10,2) DEFAULT '0.00',
`tablewareMoney` decimal(10,2) DEFAULT '0.00',
`tableId` int(11) DEFAULT '0',
`people` int(11) DEFAULT '0',
`takeNo` varchar(10) DEFAULT NULL COMMENT '取餐号',
`goodsNum` int(11) DEFAULT '0',
`payMode` int(11) DEFAULT '1' COMMENT '付款方式 1微信支付2支付宝支付3.百度支付4.公众号支付5.余额支付',
`payAt` int(11) DEFAULT '0',
`state` int(11) DEFAULT '1' COMMENT '1待付款2已付款,3.已接单4.已完成5取消6申请退款7退款通过8退款拒绝9拒单(快餐) (店内)1.待付款2已付款3已关闭',
`storeNote` varchar(50) DEFAULT NULL COMMENT '商家备注',
`userNote` varchar(50) DEFAULT NULL COMMENT '用户备注',
`orderMode` int(11) DEFAULT '1' COMMENT '1堂食2快餐',
`isOut` int(11) DEFAULT '2' COMMENT '1店内就餐2打包带走',
`regionName` varchar(30) DEFAULT NULL,
`typeName` varchar(30) DEFAULT NULL,
`number` varchar(30) DEFAULT NULL,
`eatType` int(11) DEFAULT '1' COMMENT '1.餐前支付2餐后支付',
`callNo` varchar(20) DEFAULT NULL COMMENT '叫号',
`callNum` int(11) DEFAULT '0' COMMENT '叫号数量',
`transaction_id` varchar(50) DEFAULT NULL COMMENT '微信订单号',
`subMchId` varchar(50) DEFAULT NULL COMMENT '支付的子商户号',
`payPort` int(11) DEFAULT '1' COMMENT '服务商支付判断1.商家服务商支付 2.平台服务商支付 ',
`profitSharing` int(11) DEFAULT '2' COMMENT '1是分账2不分账',
`profitSharingState` int(11) DEFAULT '2' COMMENT '1已分账2未分账3完结分账 ',
`refundMoney` decimal(10,2) DEFAULT '0.00' COMMENT '退款金额',
`preferentialMoney` decimal(10,2) DEFAULT '0.00' COMMENT '满减',
`newMoney` decimal(10,2) DEFAULT '0.00' COMMENT '新客立减',
`platformCouponPreferential` decimal(10,2) DEFAULT '0.00' COMMENT '平台优惠券金额',
`couponPreferential` decimal(10,2) DEFAULT '0.00' COMMENT '商家优惠券金额',
`couponId` varchar(100) DEFAULT NULL COMMENT '优惠券数组',
`receiptAt` int(11) DEFAULT '0' COMMENT '接单时间',
`refundNo` varchar(50) DEFAULT NULL COMMENT '退款单号',
`completeAt` int(11) DEFAULT '0',
`applyAt` int(11) DEFAULT '0' COMMENT '退款申请时间',
`beforeRefundState` int(11) DEFAULT '0' COMMENT '退款前状态',
`userDeleteAt` int(11) DEFAULT '0',
`deleteAt` int(11) DEFAULT '0',
`createdAt` int(11) DEFAULT '0',
`changeAt` int(11) DEFAULT '0',
`refundType` int(11) DEFAULT '1' COMMENT '1用户退款2商家退款',
`payType` int(11) DEFAULT '1' COMMENT '付款模式 1普通模式,2服务商模式',
PRIMARY KEY (`id`),
KEY `uniacid` (`uniacid`),
KEY `storeId` (`storeId`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;"
);
if (!pdo_fieldexists(tablename('ybwm_store_goods'), 'deleteAt')) {
pdo_query("ALTER TABLE" . tablename('ybwm_store_goods') . " ADD `deleteAt` int(11) DEFAULT '0' COMMENT '删除时间'");
}
//2021/1/8
if (!pdo_fieldexists(tablename('ybwm_print'), 'support')) {
pdo_query("ALTER TABLE" . tablename('ybwm_print') . " ADD `support` TINYINT(4) NOT NULL DEFAULT '1' COMMENT '1外卖,2堂食,3快餐,4收银'");
}
/////2021-01-09
pdo_query("ALTER TABLE " . tablename('ybwm_role_list') . " CHANGE `role_str` `role_str` text;");
if (!pdo_fieldexists(tablename('ybwm_order_goods'), 'addType')) {
pdo_query("ALTER TABLE" . tablename('ybwm_order_goods') . " ADD `addType` int(11) DEFAULT '2' COMMENT '1.加菜2普通' ");
}
if (!pdo_fieldexists(tablename('ybwm_order_goods'), 'addNum')) {
pdo_query("ALTER TABLE" . tablename('ybwm_order_goods') . " ADD `addNum` int(11) DEFAULT '0' COMMENT '加菜次数' ");
}
pdo_query("CREATE TABLE IF NOT EXISTS " . tablename('ybwm_code') . "(
`id` int(11) NOT NULL AUTO_INCREMENT,
`url` varchar(255) DEFAULT NULL COMMENT '地址',
`mediaUrl` varchar(255) DEFAULT NULL COMMENT '图片地址',
`data` varchar(255) DEFAULT NULL COMMENT '参数',
`createdAt` int(11) DEFAULT NULL,
`uniacid` int(11) DEFAULT NULL,
`storeId` int(11) DEFAULT '0',
`type` int(11) DEFAULT '1' COMMENT '1.餐桌',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;"
);
pdo_query("CREATE TABLE IF NOT EXISTS " . tablename('ybwm_table') . "(
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(20) DEFAULT NULL,
`areaId` int(11) DEFAULT NULL,
`people` int(11) DEFAULT NULL,
`sort` int(11) DEFAULT NULL,
`storeId` int(11) DEFAULT NULL,
`uniacid` int(11) DEFAULT NULL,
`createdAt` int(11) DEFAULT '0',
`changeAt` int(11) DEFAULT '0',
`deleteAt` int(11) DEFAULT '0',
`display` int(11) DEFAULT '1' COMMENT '1.显示隐藏',
`typeId` int(11) DEFAULT '0' COMMENT '类型id',
`manyType` int(11) DEFAULT '1' COMMENT '多人点餐类型1正常2锁定',
`userId` int(11) DEFAULT '0' COMMENT '点餐人id',
`state` int(11) DEFAULT '1' COMMENT '1.未开台2已开台3.就餐中',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;"
);
pdo_query("CREATE TABLE IF NOT EXISTS " . tablename('ybwm_table_area') . "(
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(20) DEFAULT NULL,
`storeId` int(11) DEFAULT NULL,
`uniacid` int(11) DEFAULT NULL,
`createdAt` int(11) DEFAULT '0',
`changeAt` int(11) DEFAULT '0',
`deleteAt` int(11) DEFAULT '0',
`goodsType` varchar(255) DEFAULT NULL,
`display` int(11) DEFAULT '1' COMMENT '1.显示2隐藏',
`sort` int(11) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;"
);
pdo_query("CREATE TABLE IF NOT EXISTS " . tablename('ybwm_table_type') . "(
`id` int(11) NOT NULL AUTO_INCREMENT,
`storeId` int(11) DEFAULT NULL,
`name` varchar(20) DEFAULT NULL,
`minNum` int(11) DEFAULT '1' COMMENT '最小人数',
`maxNum` int(11) DEFAULT '10' COMMENT '最大人数',
`display` int(11) DEFAULT '1' COMMENT '1.显示2隐藏',
`sort` int(11) DEFAULT '1',
`uniacid` int(11) DEFAULT '0',
`createdAt` int(11) DEFAULT '0',
`changeAt` int(11) DEFAULT '0',
`deleteAt` int(11) DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;"
);
//2021-01-16
if (!pdo_fieldexists(tablename('ybwm_member'), 'growth')) {
pdo_query("ALTER TABLE" . tablename('ybwm_member') . " ADD `growth` int(11) DEFAULT '0' COMMENT '成长值' ");
}
pdo_query("CREATE TABLE IF NOT EXISTS " . tablename('ybwm_user_card') . "(
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(20) DEFAULT NULL,
`bgType` int(11) DEFAULT '1' COMMENT '1.背景色2背景图',
`color` varchar(20) DEFAULT NULL COMMENT '颜色',
`bgImg` varchar(255) DEFAULT NULL COMMENT '背景图',
`condition` int(11) DEFAULT '0' COMMENT '成长值条件',
`level` int(11) DEFAULT '1' COMMENT '等级',
`rights` varchar(255) DEFAULT NULL COMMENT '权益',
`isCoupon` int(11) DEFAULT '2' COMMENT '赠送优惠券1赠送2不赠送',
`coupon` varchar(255) DEFAULT NULL COMMENT '优惠券数组',
`isBalance` int(11) DEFAULT '2' COMMENT '赠送余额1赠送2不赠送',
`balance` decimal(10,2) DEFAULT '0.00' COMMENT '赠送余额',
`isIntegral` int(11) DEFAULT '2',
`integral` int(11) DEFAULT '0',
`isGrowth` int(11) DEFAULT '2',
`growth` int(11) DEFAULT '0',
`createdAt` int(11) DEFAULT '0',
`changeAt` int(11) DEFAULT '0',
`deleteAt` int(11) DEFAULT '0',
`uniacid` int(11) DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;"
);
pdo_query("CREATE TABLE IF NOT EXISTS " . tablename('ybwm_user_card_record') . "(
`id` int(11) NOT NULL AUTO_INCREMENT,
`userId` int(11) DEFAULT NULL,
`level` int(11) DEFAULT NULL,
`createdAt` varchar(255) DEFAULT NULL,
`uniacid` int(11) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;"
);
pdo_query("CREATE TABLE IF NOT EXISTS " . tablename('ybwm_user_growth') . "(
`id` int(11) NOT NULL AUTO_INCREMENT,
`userId` int(11) NOT NULL COMMENT '用户ID',
`growth` decimal(10,2) NOT NULL COMMENT '成长值',
`createdAt` int(11) NOT NULL COMMENT '时间',
`uniacid` int(11) NOT NULL COMMENT '小程序ID',
`type` tinyint(4) NOT NULL DEFAULT '1' COMMENT '1加,2减',
`origin` tinyint(4) NOT NULL COMMENT '来源1平台,2用户',
`note` varchar(30) NOT NULL COMMENT '备注',
`accountId` int(11) NOT NULL,
PRIMARY KEY (`id`),
KEY `uniacid` (`uniacid`),
KEY `userId` (`userId`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;"
);
//2021-01-18
if (!pdo_fieldexists(tablename('ybwm_takeout_order'), 'receiveCode')) {
pdo_query("ALTER TABLE" . tablename('ybwm_takeout_order') . " ADD `receiveCode` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '收货码' ");
}
if (!pdo_fieldexists(tablename('ybwm_takeout_order'), 'pickCode')) {
pdo_query("ALTER TABLE" . tablename('ybwm_takeout_order') . " ADD `pickCode` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '收货码' ");
}
//2021-01-19
if (!pdo_fieldexists(tablename('ybwm_core_goods'), 'discountArr')) {
pdo_query("ALTER TABLE" . tablename('ybwm_core_goods') . " ADD `discountArr` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '折扣数组' ");
}
if (!pdo_fieldexists(tablename('ybwm_core_goods'), 'discountOpen')) {
pdo_query("ALTER TABLE" . tablename('ybwm_core_goods') . " ADD `discountOpen` int(11) DEFAULT '2' COMMENT '折扣1开启2关闭' ");
}
//2021-02-21
if (!pdo_fieldexists(tablename('ybwm_users'), 'appNum')) {
pdo_query("ALTER TABLE" . tablename('ybwm_users') . " ADD `appNum` int(11) DEFAULT '1' COMMENT '手机号对应的可创建平台数量' ");
}
if (!pdo_fieldexists(tablename('ybwm_users'), 'registrationId')) {
pdo_query("ALTER TABLE" . tablename('ybwm_users') . " ADD `registrationId` varchar(50) DEFAULT NULL COMMENT '激光注册ID' ");
}
//2021-03-03
if (!pdo_fieldexists(tablename('ybwm_order_goods'), 'isActivity')) {
pdo_query("ALTER TABLE" . tablename('ybwm_order_goods') . " ADD `isActivity` int(11) DEFAULT '0' COMMENT '特价商品类型' ");
}
if (!pdo_fieldexists(tablename('ybwm_shop_car'), 'discountPrice')) {
pdo_query("ALTER TABLE" . tablename('ybwm_shop_car') . " ADD `discountPrice` decimal(10,2) DEFAULT '0.00' COMMENT '折扣商品单价' ");
}
if (!pdo_fieldexists(tablename('ybwm_shop_car'), 'discountNum')) {
pdo_query("ALTER TABLE" . tablename('ybwm_shop_car') . " ADD `discountNum` int(11) DEFAULT '0' COMMENT '折扣商品数量' ");
}
if (!pdo_fieldexists(tablename('ybwm_shop_car'), 'originalDiscountPrice')) {
pdo_query("ALTER TABLE" . tablename('ybwm_shop_car') . " ADD `originalDiscountPrice` decimal(10,2) DEFAULT '0.00' COMMENT '活动商品原始价格' ");
}
if (!pdo_fieldexists(tablename('ybwm_shop_car'), 'discountType')) {
pdo_query("ALTER TABLE" . tablename('ybwm_shop_car') . " ADD `discountType` int(11) DEFAULT '0' COMMENT '1.特价2折扣3立减4第二件折扣5买一送一' ");
}
pdo_query("CREATE TABLE IF NOT EXISTS " . tablename('ybwm_good_activity') . "(
`id` int(11) NOT NULL AUTO_INCREMENT,
`goodsId` int(11) DEFAULT '0' COMMENT '商品id',
`type` int(11) DEFAULT '1' COMMENT '1特价2折扣3立减4第二件打折5.买一送一',
`storeType` int(11) DEFAULT '1' COMMENT '1本店2全店3指定门店',
`storeArr` varchar(255) DEFAULT NULL COMMENT '指定门店数组',
`limitType` int(11) DEFAULT '1' COMMENT '1.不限次数2自定义/1.每单2每日',
`limitNum` int(11) DEFAULT '1' COMMENT '自定义份数',
`startTime` int(11) DEFAULT '0',
`endTime` int(11) DEFAULT '0',
`createdAt` int(11) DEFAULT '0',
`changeAt` int(11) DEFAULT '0',
`deleteAt` int(11) DEFAULT '0',
`display` int(11) DEFAULT '1',
`storeId` int(11) DEFAULT '0' COMMENT '商家id',
`uniacid` int(11) DEFAULT '0',
`activityType` int(11) DEFAULT '1' COMMENT '1商品活动2第二件半价',
`goodsMoney` decimal(10,2) DEFAULT '0.00' COMMENT '商品特价/折扣/立减',
`stock` int(11) DEFAULT '0' COMMENT '每日库存',
`sales` int(11) DEFAULT '0' COMMENT '销量',
`abolishAt` int(11) DEFAULT '0' COMMENT '废除时间',
PRIMARY KEY (`id`),
KEY `uniacid` (`uniacid`),
KEY `goodsId` (`goodsId`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;"
);
//2021-03-10
if (!pdo_fieldexists(tablename('ybwm_issue_coupons'), 'userArr')) {
pdo_query("ALTER TABLE" . tablename('ybwm_issue_coupons') . " ADD `userArr` text COMMENT '指定用户'");
}
//2021-03-15
pdo_query("CREATE TABLE IF NOT EXISTS " . tablename('ybwm_cashier_goods') . "(
`id` int(11) NOT NULL AUTO_INCREMENT,
`userId` int(11) DEFAULT NULL COMMENT '发起人用户id',
`sonId` int(11) DEFAULT NULL COMMENT '多人点餐子用户id',
`storeId` int(11) DEFAULT NULL COMMENT '商家id',
`tableId` int(11) DEFAULT '0' COMMENT '桌子id',
`goodsId` int(11) DEFAULT NULL COMMENT '商品id',
`groupId` int(11) DEFAULT NULL COMMENT '规格组合id',
`name` varchar(20) DEFAULT NULL COMMENT '商品名称',
`icon` varchar(500) DEFAULT NULL COMMENT '商品图片',
`num` int(11) DEFAULT NULL COMMENT '数量',
`material` varchar(255) DEFAULT NULL,
`boxMoney` decimal(10,2) DEFAULT NULL,
`money` decimal(10,2) DEFAULT NULL COMMENT '金额',
`item` int(11) DEFAULT NULL COMMENT '1.外卖2店内3快餐',
`materialIds` varchar(20) DEFAULT NULL,
`createdAt` int(11) DEFAULT NULL,
`groupName` varchar(50) DEFAULT NULL COMMENT '规格字符串',
`materialName` varchar(50) DEFAULT NULL COMMENT '加料字符串',
`uniacid` int(11) DEFAULT NULL,
`originalMoney` decimal(10,2) DEFAULT NULL COMMENT '原始价格',
`attribute` text COMMENT '属性字符串',
`materialMoney` decimal(10,2) DEFAULT NULL,
`discountPrice` decimal(10,2) DEFAULT '0.00' COMMENT '折扣商品单价',
`discountNum` int(11) DEFAULT '0' COMMENT '折扣商品数量',
`originalDiscountPrice` decimal(10,2) DEFAULT '0.00' COMMENT '活动商品原始价格',
`discountType` int(11) DEFAULT '0' COMMENT '1.特价2折扣3立减4第二件折扣5买一送一',
`unit` varchar(255) DEFAULT NULL COMMENT '单位',
`isNew` varchar(255) DEFAULT '0' COMMENT '1添加购物车2加菜3退菜4落单状态',
`changeAt` int(11) DEFAULT NULL,
`type` tinyint(1) DEFAULT '1' COMMENT '1加2减',
`addNum` int(11) DEFAULT '0' COMMENT '第几次加菜',
`operatorId` int(11) DEFAULT '0' COMMENT '员工ID',
`state` tinyint(255) DEFAULT '1' COMMENT '1未付款2已下单3挂单4取消',
`cashierType` varchar(255) DEFAULT '0' COMMENT '1收银台2餐台点餐',
`outTradeNo` varchar(50) DEFAULT NULL,
`orderId` int(11) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `user_index` (`userId`) USING BTREE,
KEY `uni_index` (`uniacid`) USING BTREE,
KEY `store_index` (`storeId`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;"
);
if (!pdo_fieldexists(tablename('ybwm_table'), 'selStatus')) {
pdo_query("ALTER TABLE" . tablename('ybwm_table') . " ADD `selStatus` tinyint(1) DEFAULT '0' COMMENT '1已落单2修改中'");
}
if (!pdo_fieldexists(tablename('ybwm_table'), 'addNum')) {
pdo_query("ALTER TABLE" . tablename('ybwm_table') . " ADD `addNum` tinyint(1) DEFAULT '0' COMMENT '加菜次数'");
}
if (!pdo_fieldexists(tablename('ybwm_instore_order'), 'operatorId')) {
pdo_query("ALTER TABLE" . tablename('ybwm_instore_order') . " ADD `operatorId` int(11) DEFAULT NULL COMMENT '收银员ID'");
}
if (!pdo_fieldexists(tablename('ybwm_instore_order'), 'discount')) {
pdo_query("ALTER TABLE" . tablename('ybwm_instore_order') . " ADD `discount` decimal(10,2) DEFAULT '0.00' COMMENT '餐台收银台模式折扣抹零'");
}
if (!pdo_fieldexists(tablename('ybwm_instore_order'), 'payment')) {
pdo_query("ALTER TABLE" . tablename('ybwm_instore_order') . " ADD `payment` tinyint(1) DEFAULT '1' COMMENT '支付模式1支付宝微信2现金收款3余额收款4其他方式'");
}
if (!pdo_fieldexists(tablename('ybwm_cashier_order'), 'operatorId')) {
pdo_query("ALTER TABLE" . tablename('ybwm_cashier_order') . " ADD `operatorId` int(11) DEFAULT '0' COMMENT '收银员ID'");
}
if (!pdo_fieldexists(tablename('ybwm_cashier_order'), 'payment')) {
pdo_query("ALTER TABLE" . tablename('ybwm_cashier_order') . " ADD `payment` tinyint(1) DEFAULT '1' COMMENT '支付模式1支付宝微信2现金收款3余额收款4其他方式'");
}
if (!pdo_fieldexists(tablename('ybwm_cashier_order'), 'discount')) {
pdo_query("ALTER TABLE" . tablename('ybwm_cashier_order') . " ADD `discount` decimal(10,2) DEFAULT '0.00' COMMENT '餐台收银台模式折扣抹零'");
}
if (!pdo_fieldexists(tablename('ybwm_users'), 'loginTime')) {
pdo_query("ALTER TABLE" . tablename('ybwm_users') . " ADD `loginTime` int(11) DEFAULT NULL");
}
///////2021-03-17
if (!pdo_fieldexists(tablename('ybwm_coupon'), 'isVip')) {
pdo_query("ALTER TABLE" . tablename('ybwm_coupon') . " ADD `isVip` int(11) DEFAULT '2' COMMENT '1.会员优惠券2普通优惠券'");
}
pdo_query("CREATE TABLE IF NOT EXISTS " . tablename('ybwm_user_vip_coupon') . "(
`id` int(11) NOT NULL AUTO_INCREMENT,
`userId` int(11) DEFAULT NULL,
`couponId` varchar(255) DEFAULT NULL COMMENT '优惠券id',
`releaseAt` int(11) DEFAULT '0' COMMENT '下次发放时间',
`state` int(11) DEFAULT '2' COMMENT '1.已发放2待发放',
`uniacid` int(11) DEFAULT NULL,
`createdAt` int(11) DEFAULT '0' COMMENT '创建时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;"
);
pdo_query("CREATE TABLE IF NOT EXISTS " . tablename('ybwm_user_vip_order') . "(
`id` int(11) NOT NULL AUTO_INCREMENT,
`userId` int(11) DEFAULT NULL,
`outTradeNo` varchar(50) DEFAULT NULL,
`day` int(11) DEFAULT '0' COMMENT '天数',
`money` decimal(10,2) DEFAULT '0.00' COMMENT '金额',
`state` int(11) DEFAULT '1' COMMENT '1待支付2已支付',
`createdAt` int(11) DEFAULT '0',
`payAt` int(11) DEFAULT '0',
`uniacid` int(11) DEFAULT NULL,
`payMode` int(11) DEFAULT '1' COMMENT '付款方式 1微信支付5余额支付',
`endTime` int(11) DEFAULT '0' COMMENT '到期时间',
`transaction_id` varchar(100) DEFAULT NULL,
`first` int(11) DEFAULT '1' COMMENT '1.首次2续费',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;"
);
//2021-03-19
if (!pdo_fieldexists(tablename('ybwm_users'), 'giveTime')) {
pdo_query("ALTER TABLE" . tablename('ybwm_users') . " ADD `giveTime` int(11) DEFAULT '0' COMMENT '交班时间' ");
}
//2021-03-26
if (!pdo_fieldexists(tablename('ybwm_order_goods'), 'reason')) {
pdo_query("ALTER TABLE" . tablename('ybwm_order_goods') . " ADD `reason` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '退菜原因' ");
}
if (!pdo_fieldexists(tablename('ybwm_instore_order'), 'tablewareNum')) {
pdo_query("ALTER TABLE" . tablename('ybwm_instore_order') . " ADD `tablewareNum` int(11) DEFAULT '0' COMMENT '餐具数量' ");
}
//2021-03-31
if (!pdo_fieldexists(tablename('ybwm_shop_car'), 'discountId')) {
pdo_query("ALTER TABLE" . tablename('ybwm_shop_car') . " ADD `discountId` int(11) DEFAULT '0' COMMENT '商品活动id' ");
}
//2021-04-02
if (!pdo_fieldexists(tablename('ybwm_member'), 'bonus')) {
pdo_query("ALTER TABLE" . tablename('ybwm_member') . " ADD `bonus` int(11) DEFAULT '0' COMMENT '奖励金' ");
}
pdo_query("CREATE TABLE IF NOT EXISTS " . tablename('ybwm_old_with_new') . "(
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(20) DEFAULT NULL COMMENT '活动名称',
`startTime` int(11) DEFAULT '0',
`endTime` int(11) DEFAULT '0',
`type` int(11) DEFAULT '1' COMMENT '1.无门槛2下单次数3消费金额',
`rewardArr` varchar(500) DEFAULT NULL COMMENT '奖励数组',
`money` decimal(10,2) DEFAULT '0.00',
`num` int(11) DEFAULT '0',
`shareTitle` varchar(50) DEFAULT NULL COMMENT '分享标题',
`shareIcon` varchar(255) DEFAULT NULL COMMENT '分享图标',
`shareRule` text COMMENT '分享规则',
`createdAt` int(11) DEFAULT '0',
`changeAt` int(11) DEFAULT '0',
`uniacid` int(11) DEFAULT '0',
`deleteAt` int(11) DEFAULT '0',
`display` int(11) DEFAULT '1' COMMENT '1显示2隐藏',
`isCoupon` int(11) DEFAULT '2' COMMENT '赠送优惠券1开启2关闭',
`couponId` varchar(100) DEFAULT NULL COMMENT '优惠券数组',
`isBalance` int(11) DEFAULT '2' COMMENT '赠送余额1.开启2关闭',
`balance` decimal(10,2) DEFAULT '0.00' COMMENT '余额',
`isIntegral` int(11) DEFAULT '2' COMMENT '赠送积分1开启2关闭',
`integral` int(11) DEFAULT '0' COMMENT '赠送积分',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;"
);
pdo_query("CREATE TABLE IF NOT EXISTS " . tablename('ybwm_old_with_new_bind') . "(
`id` int(11) NOT NULL AUTO_INCREMENT,
`userId` int(11) DEFAULT '0' COMMENT '邀请人id',
`bindId` int(11) DEFAULT '0' COMMENT '绑定人id',
`createdAt` int(11) DEFAULT '0' COMMENT '绑定时间',
`uniacid` int(11) DEFAULT '0',
`state` int(11) DEFAULT '2' COMMENT '1.已完成2未完成',
`completeAt` int(11) DEFAULT '0' COMMENT '完成时间',
`actId` int(11) DEFAULT '0' COMMENT '活动id',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;"
);
pdo_query("CREATE TABLE IF NOT EXISTS " . tablename('ybwm_old_with_new_detailed') . "(
`id` int(11) NOT NULL AUTO_INCREMENT,
`userId` int(11) DEFAULT '0',
`actId` int(11) DEFAULT '0' COMMENT '活动id',
`money` decimal(10,2) DEFAULT '0.00' COMMENT '奖励金额',
`createdAt` int(11) DEFAULT '0',
`uniacid` int(11) DEFAULT '0',
`people` int(11) DEFAULT '0' COMMENT '人数',
`integral` int(11) DEFAULT '0' COMMENT '积分',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;"
);
pdo_query("CREATE TABLE IF NOT EXISTS " . tablename('ybwm_user_bonus') . "(
`id` int(11) NOT NULL AUTO_INCREMENT,
`userId` int(11) NOT NULL COMMENT '用户ID',
`money` decimal(10,2) NOT NULL COMMENT '金额',
`createdAt` int(11) NOT NULL COMMENT '时间',
`uniacid` int(11) NOT NULL COMMENT '小程序ID',
`type` tinyint(4) NOT NULL DEFAULT '1' COMMENT '1加,2减',
`origin` tinyint(4) NOT NULL COMMENT '来源1平台,2用户',
`note` varchar(30) NOT NULL COMMENT '备注',
`accountId` int(11) NOT NULL,
PRIMARY KEY (`id`),
KEY `uniacid` (`uniacid`),
KEY `userId` (`userId`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;"
);
//2021-04-09
if (!pdo_fieldexists(tablename('ybwm_takeout_order'), 'replaceUserId')) {
pdo_query("ALTER TABLE" . tablename('ybwm_takeout_order') . " ADD `replaceUserId` int(11) DEFAULT '0' COMMENT '代付用户id' ");
}
//2021-04-12
pdo_query("CREATE TABLE IF NOT EXISTS " . tablename('ybwm_ali_store') . "(
`id` int(11) NOT NULL AUTO_INCREMENT,
`shop_name` varchar(50) DEFAULT NULL COMMENT '商家名称',
`province_code` int(11) DEFAULT '0' COMMENT '省编号',
`city_code` int(11) DEFAULT '0' COMMENT '市编号',
`district_code` int(11) DEFAULT '0' COMMENT '区编号',
`address` varchar(255) DEFAULT NULL COMMENT '地址',
`shop_category_pid` varchar(20) DEFAULT '0' COMMENT '一级类目id',
`shop_category` varchar(20) DEFAULT NULL COMMENT '分类',
`store_no` varchar(50) DEFAULT NULL COMMENT '商家编号',
`contact_mobile` varchar(255) DEFAULT NULL COMMENT '手机号',
`ip_role_id` varchar(50) DEFAULT NULL COMMENT '所属商家pid',
`uniacid` int(11) DEFAULT NULL,
`state` int(11) DEFAULT '1' COMMENT '1.待审核2通过',
`storeId` int(11) DEFAULT '0' COMMENT '所属门店',
`shop_id` varchar(50) DEFAULT '' COMMENT '门店id',
`order_id` varchar(50) DEFAULT NULL COMMENT '订单id',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;"
);
//2021-04-15
if (!pdo_fieldexists(tablename('ybwm_core_goods'), 'specialType')) {
pdo_query("ALTER TABLE" . tablename('ybwm_core_goods') . " ADD `specialType` int(11) DEFAULT '0' COMMENT '0无1新品2热卖3推荐' ");
}
pdo_query("CREATE TABLE IF NOT EXISTS " . tablename('ybwm_registralist') . "(
`id` int(11) NOT NULL AUTO_INCREMENT,
`userId` int(11) NOT NULL,
`registrationId` varchar(255) NOT NULL,
`createdAt` int(11) NOT NULL,
`uniacid` int(11) NOT NULL,
`storeId` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;"
);
//2021-04-21
pdo_query("CREATE TABLE IF NOT EXISTS " . tablename('ybwm_bonus_withdrawal') . "(
`id` int(11) NOT NULL AUTO_INCREMENT,
`outTradeNo` varchar(50) DEFAULT NULL,
`item` int(11) DEFAULT '1' COMMENT '1.老带新2.分销商',
`type` int(11) DEFAULT '1' COMMENT '提现方式,1微信,2银联,3支付宝4.余额',
`userId` int(11) DEFAULT '0',
`account` varchar(500) DEFAULT NULL COMMENT '账户信息',
`money` decimal(10,2) DEFAULT NULL,
`actualMoney` decimal(10,2) DEFAULT '0.00' COMMENT '实际金额',
`charge` decimal(10,2) DEFAULT '0.00' COMMENT '手续费',
`state` int(11) DEFAULT '1' COMMENT '1申请中,2已通过,3已拒绝',
`uniacid` int(11) DEFAULT '0',
`createdAt` int(11) DEFAULT '0',
`deleteAt` int(11) DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;"
);
if (!pdo_fieldexists(tablename('ybwm_user_bonus'), 'item')) {
pdo_query("ALTER TABLE" . tablename('ybwm_user_bonus') . " ADD `item` int(11) DEFAULT '1' COMMENT '1.老带新2分销商'");
}
//2021-04-22
if (!pdo_fieldexists(tablename('ybwm_member'), 'commission')) {
pdo_query("ALTER TABLE" . tablename('ybwm_member') . " ADD `commission` decimal(10,2) DEFAULT '0.00' ");
}
pdo_query("ALTER TABLE " . tablename('ybwm_member') . " CHANGE `bonus` `bonus` decimal(10,2) DEFAULT '0.00' ");
//2021-04-24
pdo_query("CREATE TABLE IF NOT EXISTS " . tablename('ybwm_distribution') . "(
`id` int(11) NOT NULL AUTO_INCREMENT,
`userId` int(11) DEFAULT '0',
`name` varchar(20) DEFAULT NULL COMMENT '分销商名称',
`tel` varchar(20) DEFAULT NULL COMMENT '电话',
`state` int(11) DEFAULT '1' COMMENT '1待审核2已通过3已拒绝',
`createdAt` int(11) DEFAULT '0',
`uniacid` int(11) DEFAULT '0',
`deleteAt` int(11) DEFAULT '0',
`changeAt` int(11) DEFAULT '0',
`examineAt` int(11) DEFAULT '0' COMMENT '成为分销商时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;"
);
pdo_query("CREATE TABLE IF NOT EXISTS " . tablename('ybwm_distribution_bind') . "(
`id` int(11) NOT NULL AUTO_INCREMENT,
`userId` int(11) DEFAULT '0' COMMENT '邀请人id',
`bindId` int(11) DEFAULT '0' COMMENT '绑定人id',
`createdAt` int(11) DEFAULT '0' COMMENT '绑定时间',
`uniacid` int(11) DEFAULT '0',
`twoId` int(11) DEFAULT '0' COMMENT '上级的上级id',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;"
);
pdo_query("CREATE TABLE IF NOT EXISTS " . tablename('ybwm_distribution_order') . "(
`id` int(11) NOT NULL AUTO_INCREMENT,
`userId` int(11) DEFAULT '0' COMMENT '下级id',
`distributionId` int(11) DEFAULT '0' COMMENT '分销商用户id',
`outTradeNo` varchar(50) DEFAULT NULL COMMENT '订单b编号',
`item` int(11) DEFAULT '1' COMMENT '1.外卖2店内3快餐4收银',
`type` int(11) DEFAULT '2' COMMENT '1冻结,2正常',
`money` decimal(10,2) DEFAULT '0.00' COMMENT '佣金',
`createdAt` int(11) DEFAULT '0',
`entryAt` int(11) DEFAULT '0' COMMENT '入账时间',
`level` int(11) DEFAULT '1' COMMENT '1.一级2二级',
`uniacid` int(11) DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;"
);
if (!pdo_fieldexists(tablename('ybwm_member'), 'login_token')) {
pdo_query("ALTER TABLE" . tablename('ybwm_member') . " ADD `login_token` varchar(255) DEFAULT NULL COMMENT '登录票据' ");
}
//2021-05-07
pdo_query("CREATE TABLE IF NOT EXISTS " . tablename('ybwm_ali_auth') . "(
`id` int(11) NOT NULL AUTO_INCREMENT,
`storeId` int(11) DEFAULT '0',
`uniacid` int(11) DEFAULT '0',
`state` int(11) DEFAULT '1' COMMENT '1.待确认2成功',
`createdAt` int(11) DEFAULT '0',
`changeAt` int(11) DEFAULT '0',
`account` varchar(50) DEFAULT NULL COMMENT '账号',
`batch_no` varchar(50) DEFAULT NULL COMMENT '授权订单号',
`merchant_no` varchar(50) DEFAULT NULL COMMENT '支付宝商户号',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;"
);
//2021-05-17
if (!pdo_fieldexists(tablename('ybwm_store_goods'), 'boxMoney')) {
pdo_query("ALTER TABLE" . tablename('ybwm_store_goods') . " ADD `boxMoney` decimal(10,2) DEFAULT '0.00'");
}
//2021-05-20
pdo_query("CREATE TABLE IF NOT EXISTS " . tablename('ybwm_store_bill') . "(
`id` int(11) NOT NULL AUTO_INCREMENT,
`storeId` int(11) DEFAULT NULL COMMENT '商户ID',
`origin` int(11) DEFAULT '0' COMMENT '订单来源1外卖2店内3快餐4当面付5券包6提现7.提现拒绝8.扣除手续费',
`item` tinyint(4) DEFAULT '1' COMMENT '1加,2减',
`money` decimal(15,2) DEFAULT NULL COMMENT '金额',
`currentMoney` decimal(15,2) DEFAULT NULL COMMENT '当前余额',
`note` varchar(50) DEFAULT NULL COMMENT '备注',
`uniacid` int(11) DEFAULT NULL,
`createdAt` int(11) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `uniacid` (`uniacid`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;"
);
//2021-05-21
if (!pdo_fieldexists(tablename('ybwm_store_bill'), 'outTradeNo')) {
pdo_query("ALTER TABLE" . tablename('ybwm_store_bill') . " ADD `outTradeNo` varchar(50) DEFAULT NULL");
}
if (!pdo_fieldexists(tablename('ybwm_bill'), 'platform')) {
pdo_query("ALTER TABLE" . tablename('ybwm_bill') . " ADD `platform` int(11) DEFAULT '1' COMMENT '1微信小程序,3支付宝,5收银台'");
}
if (!pdo_fieldexists(tablename('ybwm_core_category'), 'oldCategoryId')) {
pdo_query("ALTER TABLE" . tablename('ybwm_core_category') . " ADD `oldCategoryId` int(11) DEFAULT '0'");
}
if (!pdo_fieldexists(tablename('ybwm_print'), 'printModeType')) {
pdo_query("ALTER TABLE" . tablename('ybwm_print') . " ADD `printModeType` tinyint(4) DEFAULT '1'");
}
//2021-05-27
if (!pdo_fieldexists(tablename('ybwm_user_card'), 'display')) {
pdo_query("ALTER TABLE" . tablename('ybwm_user_card') . " ADD `display` int(11) DEFAULT '1' COMMENT '1.显示2隐藏'");
}
if (!pdo_fieldexists(tablename('ybwm_users'), 'userId')) {
pdo_query("ALTER TABLE" . tablename('ybwm_users') . " ADD `userId` int(11)");
}
pdo_query("CREATE TABLE IF NOT EXISTS " . tablename('ybwm_merchant_member') . "(
`id` int(11) NOT NULL AUTO_INCREMENT,
`openId` varchar(100) NOT NULL,
`userName` varchar(30) DEFAULT NULL COMMENT '昵称',
`userTel` varchar(20) DEFAULT NULL COMMENT '手机号',
`level` tinyint(1) DEFAULT NULL,
`portrait` varchar(255) DEFAULT NULL COMMENT '头像',
`createdAt` int(11) DEFAULT NULL COMMENT '创建时间',
`changeAt` int(11) NOT NULL COMMENT '修改时间',
`bindType` tinyint(4) DEFAULT NULL COMMENT '1微信小程序2微信公众号3支付宝小程序4百度小程序',
`uniacid` int(11) DEFAULT NULL COMMENT '小程序ID',
`deleteAt` int(11) DEFAULT '0' COMMENT '删除时间',
`isBlack` tinyint(4) DEFAULT '2' COMMENT '1拉黑,2否',
`rankId` int(11) DEFAULT '0' COMMENT '等级Id',
`vipEndTime` int(11) DEFAULT '0' COMMENT '会员到期时间',
`realName` varchar(30) DEFAULT NULL COMMENT '真实姓名',
`birthday` varchar(20) DEFAULT NULL COMMENT '生日',
`sex` varchar(10) DEFAULT NULL,
`WeChatCard` int(11) DEFAULT '2' COMMENT '微信卡包 1激活2未激活',
`WeChatCardCode` varchar(255) DEFAULT NULL COMMENT '微信会员卡卡号',
`WeChatCardId` varchar(255) DEFAULT NULL COMMENT '微信会员卡id',
`wechatOpenId` varchar(50) DEFAULT NULL COMMENT '公众号openId',
`wechatUniacid` int(11) DEFAULT NULL,
`status` tinyint(1) DEFAULT '1' COMMENT '1正常 2删除',
`sourceType` tinyint(1) DEFAULT '1' COMMENT '2excel文件导入的客户',
`vipCode` varchar(50) DEFAULT NULL COMMENT '会员卡号',
`balance` decimal(10,2) DEFAULT NULL,
`integral` int(11) DEFAULT NULL,
`growth` int(11) DEFAULT '0' COMMENT '成长值',
`vipLabel` int(11) NOT NULL,
`userType` tinyint(1) DEFAULT '1' COMMENT '用户来源1微信小程序',
`browseStoreId` int(11) DEFAULT '0' COMMENT '上次浏览的店铺',
`login_token` varchar(255) DEFAULT NULL COMMENT '登录票据',
`bonus` decimal(10,2) DEFAULT '0.00' COMMENT '奖励金',
`commission` decimal(10,2) DEFAULT '0.00' COMMENT '佣金',
PRIMARY KEY (`id`),
KEY `uniacid` (`uniacid`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;"
);
pdo_query("ALTER TABLE " . tablename('ybwm_core_goods') . " CHANGE `discountArr` `discountArr` text COLLATE utf8mb4_unicode_ci COMMENT '折扣数组'");
/////2021-06-15
pdo_query("CREATE TABLE IF NOT EXISTS " . tablename('ybwm_storage_brand') . "(
`id` int(11) NOT NULL AUTO_INCREMENT,
`storeId` int(11) NOT NULL COMMENT '门店ID',
`name` varchar(30) NOT NULL,
`body` varchar(255) NOT NULL COMMENT '说明',
`sort` int(11) NOT NULL DEFAULT '1' COMMENT '排序',
`display` int(11) NOT NULL DEFAULT '1' COMMENT '1显示,2隐藏',
`createdAt` int(11) NOT NULL COMMENT '创建时间',
`deleteAt` int(11) NOT NULL COMMENT '删除时间',
`uniacid` int(11) NOT NULL COMMENT '小程序ID',
`changeAt` int(11) DEFAULT '0',
PRIMARY KEY (`id`),
KEY `uniacid` (`uniacid`),
KEY `storeId` (`storeId`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;"
);
pdo_query("CREATE TABLE IF NOT EXISTS " . tablename('ybwm_storage_order') . "(
`id` int(11) NOT NULL AUTO_INCREMENT,
`storeId` int(11) NOT NULL COMMENT '门店ID',
`userId` int(11) NOT NULL COMMENT '用户ID',
`outTradeNo` varchar(32) NOT NULL COMMENT '订单编号',
`userName` varchar(20) NOT NULL COMMENT '联系人',
`userTel` varchar(20) NOT NULL COMMENT '联系电话',
`name` varchar(100) NOT NULL COMMENT '酒水名称',
`totalNum` int(11) NOT NULL COMMENT '总数量',
`takeNum` int(11) NOT NULL COMMENT '取走数量',
`note` varchar(255) NOT NULL COMMENT '备注',
`state` int(11) NOT NULL DEFAULT '1' COMMENT '1待审核,2通过,3拒绝,4已失效',
`createdAt` int(11) NOT NULL COMMENT '创建时间',
`endAt` int(11) NOT NULL COMMENT '到期时间',
`deleteAt` int(11) NOT NULL COMMENT '删除时间',
`uniacid` int(11) NOT NULL COMMENT '小程序ID',
`userDeleteAt` int(11) DEFAULT '0',
`surplusNum` int(11) DEFAULT '0',
`type` int(11) DEFAULT '1' COMMENT '1.存酒2取酒',
`storageId` int(11) DEFAULT '0',
PRIMARY KEY (`id`),
KEY `uniacid` (`uniacid`),
KEY `storeId` (`storeId`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;"
);
pdo_query("ALTER TABLE " . tablename('ybwm_good_specs') . " CHANGE `boxMoney` `boxMoney` decimal(10,2) DEFAULT '0.00' ");
//2021-06-17
pdo_query("CREATE TABLE IF NOT EXISTS " . tablename('ybwm_queuing') . "(
`id` int(11) NOT NULL AUTO_INCREMENT,
`origin` int(11) DEFAULT '1',
`userId` int(11) DEFAULT NULL COMMENT '用户ID',
`storeId` int(11) DEFAULT NULL COMMENT '门店ID',
`tableId` int(11) DEFAULT NULL COMMENT '桌位ID',
`code` varchar(10) DEFAULT NULL COMMENT '编号',
`name` varchar(50) DEFAULT NULL COMMENT '餐桌名称',
`people` int(11) DEFAULT NULL COMMENT '就餐人数',
`tel` varchar(20) DEFAULT NULL COMMENT '手机号',
`state` int(11) DEFAULT '1' COMMENT '1取号2就餐3过号4取消',
`createdAt` int(11) DEFAULT NULL COMMENT '创建时间',
`deleteAt` int(11) DEFAULT '0' COMMENT '删除时间戳',
`day` varchar(20) DEFAULT NULL COMMENT '日期',
`uniacid` int(11) DEFAULT NULL COMMENT '小程序Id',
`userDeleteAt` int(11) DEFAULT '0',
PRIMARY KEY (`id`),
KEY `uniacid` (`uniacid`),
KEY `storeId` (`storeId`),
KEY `day` (`day`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;"
);
pdo_query("CREATE TABLE IF NOT EXISTS " . tablename('ybwm_queuing_type') . "(
`id` int(11) NOT NULL AUTO_INCREMENT,
`storeId` int(11) DEFAULT '0' COMMENT '门店ID',
`name` varchar(50) DEFAULT NULL COMMENT '名称',
`min` int(11) DEFAULT '0' COMMENT '最小值',
`max` int(11) DEFAULT '0' COMMENT '最大值',
`minute` varchar(10) DEFAULT NULL COMMENT '等待时间,分钟',
`createdAt` int(11) DEFAULT '0',
`display` int(11) DEFAULT '1' COMMENT '1显示,2隐藏',
`sort` int(11) DEFAULT '0' COMMENT '排序',
`uniacid` int(11) DEFAULT '0' COMMENT '小程序ID',
`deleteAt` int(11) DEFAULT '0' COMMENT '删除时间戳',
`changeAt` int(11) DEFAULT '0',
PRIMARY KEY (`id`),
KEY `storeId` (`storeId`),
KEY `uniacid` (`uniacid`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;"
);
//2021/06/18
if (!pdo_fieldexists(tablename('ybwm_storage_order'), 'origin')) {
pdo_query("ALTER TABLE" . tablename('ybwm_storage_order') . " ADD `origin` int(11) DEFAULT '1' ");
}
//2021/06/25
if (!pdo_fieldexists(tablename('ybwm_shop_car'), 'operatorId')) {
pdo_query("ALTER TABLE" . tablename('ybwm_shop_car') . " ADD `operatorId` int(11) DEFAULT '0' ");
}
//2021-07-01
pdo_query("CREATE TABLE IF NOT EXISTS " . tablename('ybwm_appointment') . "(
`id` int(11) NOT NULL AUTO_INCREMENT,
`userId` int(11) NOT NULL DEFAULT '0',
`storeId` int(11) NOT NULL DEFAULT '0',
`uniacid` int(11) NOT NULL DEFAULT '0',
`state` int(11) NOT NULL DEFAULT '0' COMMENT '1待支付2待确认3已通过4.已拒绝5.确认到店6已取消',
`money` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '金额',
`outTradeNo` varchar(20) DEFAULT NULL COMMENT '订单号',
`origin` int(11) NOT NULL DEFAULT '1' COMMENT '订单来源1微信小程序,2微信公众号3支付宝,4百度5.h5 6.pc 7.头条',
`payMode` int(11) NOT NULL DEFAULT '1' COMMENT '付款方式 1微信支付2支付宝支付3.百度支付4.公众号支付',
`payAt` int(11) NOT NULL DEFAULT '0' COMMENT '支付时间',
`createdAt` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
`deleteAt` int(11) NOT NULL DEFAULT '0' COMMENT '删除时间',
`userDeleteAt` int(11) NOT NULL DEFAULT '0' COMMENT '用户删除时间',
`people` int(11) NOT NULL DEFAULT '0' COMMENT '人数',
`serviceDay` varchar(20) DEFAULT NULL COMMENT '预约时间',
`serviceTime` varchar(20) DEFAULT NULL COMMENT '预约时间点数',
`region` varchar(30) DEFAULT NULL COMMENT '位置',
`userName` varchar(20) DEFAULT NULL,
`userTel` varchar(20) DEFAULT NULL,
`sex` varchar(20) DEFAULT NULL,
`note` varchar(50) DEFAULT NULL COMMENT '备注',
`cancelReason` varchar(20) DEFAULT NULL COMMENT '取消原因',
`refuseReason` varchar(20) DEFAULT NULL COMMENT '拒绝原因',
`auditAt` int(11) DEFAULT NULL COMMENT '审核时间',
`originalUniacid` int(11) DEFAULT NULL COMMENT '原始小程序id',
`transaction_id` varchar(50) DEFAULT NULL COMMENT '微信订单号',
`subMchId` varchar(50) DEFAULT NULL COMMENT '支付的子商户号',
`payPort` int(11) DEFAULT '1' COMMENT '服务商支付判断1.商家服务商支付 2.平台服务商支付',
`profitSharing` int(11) DEFAULT '2' COMMENT '1是分账2不分账',
`profitSharingState` int(11) DEFAULT '2' COMMENT '1已分账2未分账3完结分账',
`payType` int(11) NOT NULL DEFAULT '1',
`serviceAt` int(11) NOT NULL,
`code` varchar(20) DEFAULT NULL COMMENT '核销码',
`refundNo` varchar(50) DEFAULT NULL COMMENT '退款单号',
`refundMoney` decimal(10,2) DEFAULT '0.00' COMMENT '退款金额',
`changeAt` int(11) DEFAULT '0',
`refundType` int(11) DEFAULT '0' COMMENT '1.用户2商家',
PRIMARY KEY (`id`),
KEY `userId` (`userId`),
KEY `storeId` (`storeId`),
KEY `uniacid` (`uniacid`),
KEY `state` (`state`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;"
);
if (!pdo_fieldexists(tablename('ybwm_table_area'), 'appointment')) {
pdo_query("ALTER TABLE" . tablename('ybwm_table_area') . " ADD `appointment` int(11) DEFAULT '2' COMMENT '1.开启2关闭' ");
}
if (!pdo_fieldexists(tablename('ybwm_table_area'), 'money')) {
pdo_query("ALTER TABLE" . tablename('ybwm_table_area') . " ADD `money` decimal(10,2) DEFAULT '0.00' COMMENT '预约金额' ");
}
if (!pdo_fieldexists(tablename('ybwm_table_area'), 'minNum')) {
pdo_query("ALTER TABLE" . tablename('ybwm_table_area') . " ADD `minNum` int(11) DEFAULT '1' COMMENT '最小人数' ");
}
if (!pdo_fieldexists(tablename('ybwm_table_area'), 'maxNum')) {
pdo_query("ALTER TABLE" . tablename('ybwm_table_area') . " ADD `maxNum` int(11) DEFAULT '10' COMMENT '最大人数' ");
}
//2021-07-15
pdo_query("CREATE TABLE IF NOT EXISTS " . tablename('ybwm_dividend') . "(
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(100) NOT NULL COMMENT '活动名称',
`startTime` int(11) NOT NULL COMMENT '开始时间',
`endTime` int(11) NOT NULL COMMENT '结束时间',
`payMoney` decimal(10,2) NOT NULL COMMENT '触发金额',
`createdAt` int(11) NOT NULL COMMENT '创建时间',
`deleteAt` int(11) NOT NULL COMMENT '删除时间',
`uniacid` int(11) NOT NULL COMMENT '小程序Id',
`couponName` varchar(50) DEFAULT NULL,
`couponStartAt` int(11) DEFAULT NULL COMMENT '红包有效期',
`couponEndAt` int(255) DEFAULT NULL COMMENT '红包有效期',
`position` int(11) DEFAULT '1' COMMENT '1.点单页',
`orFullMoney` decimal(10,2) DEFAULT NULL COMMENT '普通门槛',
`orReduce` decimal(10,2) DEFAULT NULL COMMENT '普通减免',
`opFullMoney` decimal(10,2) DEFAULT NULL COMMENT '最佳门槛',
`opReduce` decimal(10,2) DEFAULT NULL COMMENT '最佳减免',
`useDay` int(11) DEFAULT '1' COMMENT '领取后几日内有效',
`useType` varchar(50) DEFAULT NULL COMMENT '使用类型1.外卖2自提3.堂食4快餐',
`receiveNum` int(11) DEFAULT '0' COMMENT '最多可领',
`luck` int(11) DEFAULT '0' COMMENT '第几个手气王',
`shareImg` varchar(255) DEFAULT NULL,
`shareTitle` varchar(255) DEFAULT NULL,
`details` text,
`display` int(11) DEFAULT '1' COMMENT '1.显示2隐藏',
`changeAt` int(11) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `uniacid` (`uniacid`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;"
);
pdo_query("CREATE TABLE IF NOT EXISTS " . tablename('ybwm_dividend_join') . "(
`id` int(11) NOT NULL AUTO_INCREMENT,
`divideId` int(11) DEFAULT NULL COMMENT '瓜分红包活动ID',
`divideName` varchar(50) DEFAULT NULL COMMENT '瓜分红包活动名称',
`orderId` int(11) DEFAULT '0' COMMENT '订单id',
`userId` int(11) DEFAULT NULL,
`totalNum` int(11) DEFAULT NULL COMMENT '红包总个数',
`surplusNum` int(11) unsigned DEFAULT NULL COMMENT '剩余个数',
`createdAt` int(11) DEFAULT NULL,
`uniacid` int(11) DEFAULT NULL COMMENT '小程序ID',
`luck` int(11) DEFAULT '0' COMMENT '第几个手气王',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;"
);
pdo_query("CREATE TABLE IF NOT EXISTS " . tablename('ybwm_dividend_receive') . "(
`id` int(11) NOT NULL AUTO_INCREMENT,
`joinId` int(11) DEFAULT NULL COMMENT '红包参与Id',
`userId` int(11) DEFAULT NULL COMMENT '领取人ID',
`couponId` int(11) DEFAULT NULL COMMENT '领取优惠券ID',
`createdAt` int(11) DEFAULT NULL COMMENT '创建时间',
`uniacid` int(11) DEFAULT NULL COMMENT '小程序ID',
`lucky` int(11) DEFAULT '2' COMMENT '1.手气王2不是',
`fullMoney` decimal(10,2) DEFAULT '0.00',
`money` decimal(10,2) DEFAULT '0.00',
`useDay` int(11) DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;"
);
if (!pdo_fieldexists(tablename('ybwm_instore_order'), 'vipDiscount')) {
pdo_query("ALTER TABLE" . tablename('ybwm_instore_order') . " ADD `vipDiscount` decimal(10,2) DEFAULT '0.00' COMMENT '会员优惠' ");
}
//2021-07-19
if (!pdo_fieldexists(tablename('ybwm_comment'), 'outTradeNo')) {
pdo_query("ALTER TABLE" . tablename('ybwm_comment') . " ADD `outTradeNo` varchar(32) DEFAULT NULL COMMENT '订单编号' ");
}
if (!pdo_fieldexists(tablename('ybwm_comment'), 'changeAt')) {
pdo_query("ALTER TABLE" . tablename('ybwm_comment') . " ADD `changeAt` int(11) DEFAULT '0' ");
}
pdo_query("ALTER TABLE " . tablename('ybwm_site_set') . " CHANGE `copyright_str` `copyright_str` text;");
if (!pdo_fieldexists(tablename('ybwm_member'), 'unionid')) {
pdo_query("ALTER TABLE" . tablename('ybwm_member') . " ADD `unionid` varchar(50) DEFAULT NULL ");
}
//2021-07-29
if (!pdo_fieldexists(tablename('ybwm_user_card'), 'isCashier')) {
pdo_query("ALTER TABLE" . tablename('ybwm_user_card') . " ADD `isCashier` int(11) DEFAULT '2' COMMENT '1.开启2关闭' ");
}
if (!pdo_fieldexists(tablename('ybwm_user_card'), 'cashierDiscount')) {
pdo_query("ALTER TABLE" . tablename('ybwm_user_card') . " ADD `cashierDiscount` decimal(10,2) DEFAULT '0.00' ");
}
if (!pdo_fieldexists(tablename('ybwm_exchange_code_info'), 'userId')) {
pdo_query("ALTER TABLE" . tablename('ybwm_exchange_code_info') . " ADD `userId` int(11) DEFAULT '0' ");
}
if (!pdo_fieldexists(tablename('ybwm_coupon'), 'isHx')) {
pdo_query("ALTER TABLE" . tablename('ybwm_coupon') . " ADD `isHx` int(11) DEFAULT '2' ");
}
if (!pdo_fieldexists(tablename('ybwm_coupon'), 'goodsArr2')) {
pdo_query("ALTER TABLE" . tablename('ybwm_coupon') . " ADD `goodsArr2` varchar(255) DEFAULT NULL");
}
if (!pdo_fieldexists(tablename('ybwm_store_reduce'), 'storeArr')) {
pdo_query("ALTER TABLE" . tablename('ybwm_store_reduce') . " ADD `storeArr` varchar(255) DEFAULT NULL");
}
if (!pdo_fieldexists(tablename('ybwm_new_reduction'), 'storeArr')) {
pdo_query("ALTER TABLE" . tablename('ybwm_new_reduction') . " ADD `storeArr` varchar(255) DEFAULT NULL");
}
if (!pdo_fieldexists(tablename('ybwm_delivery_preferential'), 'storeArr')) {
pdo_query("ALTER TABLE" . tablename('ybwm_delivery_preferential') . " ADD `storeArr` varchar(255) DEFAULT NULL");
}
if (!pdo_fieldexists(tablename('ybwm_window_coupon'), 'storeType')) {
pdo_query("ALTER TABLE" . tablename('ybwm_delivery_preferential') . " ADD `storeType` int(11) DEFAULT '1'");
}
if (!pdo_fieldexists(tablename('ybwm_window_coupon'), 'storeArr')) {
pdo_query("ALTER TABLE" . tablename('ybwm_delivery_preferential') . " ADD `storeArr` varchar(255) DEFAULT NULL");
}
if (!pdo_fieldexists(tablename('ybwm_change_pay'), 'useType')) {
pdo_query("ALTER TABLE" . tablename('ybwm_change_pay') . " ADD `useType` varchar(50) DEFAULT NULL");
}
if (!pdo_fieldexists(tablename('ybwm_change_pay'), 'goodsArr2')) {
pdo_query("ALTER TABLE" . tablename('ybwm_change_pay') . " ADD `goodsArr2` varchar(255) DEFAULT NULL");
}
if (!pdo_fieldexists(tablename('ybwm_good_activity'), 'useType')) {
pdo_query("ALTER TABLE" . tablename('ybwm_good_activity') . " ADD `useType` varchar(50) DEFAULT NULL");
}
if (!pdo_fieldexists(tablename('ybwm_good_activity'), 'goodsArr')) {
pdo_query("ALTER TABLE" . tablename('ybwm_good_activity') . " ADD `goodsArr` varchar(255) DEFAULT NULL");
}
if (!pdo_fieldexists(tablename('ybwm_good_activity'), 'goodsArr2')) {
pdo_query("ALTER TABLE" . tablename('ybwm_good_activity') . " ADD `goodsArr2` varchar(255) DEFAULT NULL");
}
if (!pdo_fieldexists(tablename('ybwm_delivery_preferential'), 'storeType')) {
pdo_query("ALTER TABLE" . tablename('ybwm_delivery_preferential') . " ADD `storeType` varchar(50) DEFAULT NULL");
}
if (!pdo_fieldexists(tablename('ybwm_store_reduce'), 'storeType')) {
pdo_query("ALTER TABLE" . tablename('ybwm_store_reduce') . " ADD `storeType` varchar(50) DEFAULT NULL");
}
pdo_query("ALTER TABLE " . tablename('ybwm_store_reduce') . " CHANGE `useType` `useType` varchar(50) NOT NULL;");
if (!pdo_fieldexists(tablename('ybwm_give'), 'useType')) {
pdo_query("ALTER TABLE" . tablename('ybwm_give') . " ADD `useType` varchar(50) DEFAULT NULL");
}
if (!pdo_fieldexists(tablename('ybwm_user_coupon'), 'goodsArr2')) {
pdo_query("ALTER TABLE" . tablename('ybwm_user_coupon') . " ADD `goodsArr2` varchar(255) DEFAULT NULL");
}
if (!pdo_fieldexists(tablename('ybwm_exchange_code_info'), 'userId')) {
pdo_query("ALTER TABLE" . tablename('ybwm_exchange_code_info') . " ADD `userId` int(11) DEFAULT '0'");
}
if (!pdo_fieldexists(tablename('ybwm_user_card'), 'isCashier')) {
pdo_query("ALTER TABLE" . tablename('ybwm_user_card') . " ADD `isCashier` int(11) DEFAULT '2'");
}
if (!pdo_fieldexists(tablename('ybwm_user_card'), 'cashierDiscount')) {
pdo_query("ALTER TABLE" . tablename('ybwm_user_card') . " ADD `cashierDiscount` decimal(10,2) DEFAULT '0.00'");
}
pdo_query("ALTER TABLE " . tablename('ybwm_good_activity') . " CHANGE `goodsArr` `goodsArr` text(0) NOT NULL;");
pdo_query("ALTER TABLE " . tablename('ybwm_good_activity') . " CHANGE `goodsArr2` `goodsArr` text(0) NOT NULL;");
if (!pdo_fieldexists(tablename('ybwm_user_coupon'), 'selfCode')) {
pdo_query("ALTER TABLE" . tablename('ybwm_user_coupon') . " ADD `selfCode` int(11) DEFAULT NULL");
}
if (!pdo_fieldexists(tablename('ybwm_core_goods'), 'pinYin')) {
pdo_query("ALTER TABLE" . tablename('ybwm_core_goods') . " ADD `pinYin` int(11) DEFAULT NULL");
}
if (!pdo_fieldexists(tablename('ybwm_takeout_order'), 'collectCouponId')) {
pdo_query("ALTER TABLE" . tablename('ybwm_takeout_order') . " ADD `collectCouponId` int(11) DEFAULT NULL");
}
if (!pdo_fieldexists(tablename('ybwm_takeout_order'), 'collectCouponName')) {
pdo_query("ALTER TABLE" . tablename('ybwm_takeout_order') . " ADD `collectCouponName` varchar(255) DEFAULT NULL");
}
pdo_query("CREATE TABLE IF NOT EXISTS " . tablename('ybwm_order_collect_coupon') . "(
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(20) DEFAULT NULL COMMENT '活动名称',
`startTime` int(11) DEFAULT NULL,
`endTime` int(11) DEFAULT NULL,
`taskCycle` int(11) DEFAULT NULL,
`orderNum` int(11) DEFAULT NULL,
`money` decimal(10,2) DEFAULT NULL,
`timeType` int(11) DEFAULT '1' COMMENT '1.固定日期2领券后几日有效',
`isNextDay` int(11) DEFAULT '2' COMMENT '1次日起',
`day` int(11) DEFAULT '1' COMMENT '几日有效',
`useEndTime` int(11) DEFAULT NULL COMMENT '使用结束时间',
`storeType` int(11) DEFAULT '1' COMMENT '1.本店可用2全店通用3.指定门店',
`storeArr` varchar(255) DEFAULT NULL COMMENT '指定门店数组',
`createdAt` int(11) DEFAULT '0',
`changeAt` int(11) DEFAULT '0',
`deleteAt` int(11) DEFAULT '0',
`display` int(11) DEFAULT '1',
`uniacid` int(11) DEFAULT '0',
`storeId` int(11) DEFAULT '0',
`type` tinyint(1) DEFAULT '1' COMMENT '1集点返红包',
`moneyType` tinyint(1) DEFAULT NULL,
`orderType` tinyint(1) DEFAULT NULL,
`useStartTime` int(11) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;"
);
if (!pdo_fieldexists(tablename('ybwm_core_file'), 'fileType')) {
pdo_query("ALTER TABLE" . tablename('ybwm_core_file') . " ADD `fileType` tinyint(1) DEFAULT '1'");
}
if (!pdo_fieldexists(tablename('ybwm_print'), 'areaId')) {
pdo_query("ALTER TABLE" . tablename('ybwm_print') . " ADD `areaId` varchar(255) DEFAULT NULL");
}
if (!pdo_fieldexists(tablename('ybwm_print'), 'printMode2')) {
pdo_query("ALTER TABLE" . tablename('ybwm_print') . " ADD `printMode2` varchar(255) DEFAULT NULL");
}
?>