<?php
/**
* 渔枫 源码
* https://mofangmall.com
* QQ 5090531 承接网站建设、公众号搭建、小程序建设、企业网站
*/
pdo_query("CREATE TABLE IF NOT EXISTS `ims_superman_creditmall_activity_clerks` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`uniacid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '公众号id',
`uid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '关联users表uid',
`storeid` int(10) unsigned NOT NULL DEFAULT '0',
`name` varchar(20) NOT NULL DEFAULT '',
`password` varchar(20) NOT NULL DEFAULT '',
`mobile` varchar(20) NOT NULL DEFAULT '',
`openid` varchar(50) NOT NULL DEFAULT '',
`nickname` varchar(30) NOT NULL DEFAULT '',
PRIMARY KEY (`id`),
KEY `ind_uniacid` (`uniacid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;
");
if(!pdo_fieldexists('superman_creditmall_activity_clerks','id')) {pdo_query("ALTER TABLE ".tablename('superman_creditmall_activity_clerks')." ADD
`id` int(11) NOT NULL AUTO_INCREMENT");}
if(!pdo_fieldexists('superman_creditmall_activity_clerks','uniacid')) {pdo_query("ALTER TABLE ".tablename('superman_creditmall_activity_clerks')." ADD `uniacid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '公众号id'");}
if(!pdo_fieldexists('superman_creditmall_activity_clerks','uid')) {pdo_query("ALTER TABLE ".tablename('superman_creditmall_activity_clerks')." ADD `uid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '关联users表uid'");}
if(!pdo_fieldexists('superman_creditmall_activity_clerks','storeid')) {pdo_query("ALTER TABLE ".tablename('superman_creditmall_activity_clerks')." ADD `storeid` int(10) unsigned NOT NULL DEFAULT '0'");}
if(!pdo_fieldexists('superman_creditmall_activity_clerks','name')) {pdo_query("ALTER TABLE ".tablename('superman_creditmall_activity_clerks')." ADD `name` varchar(20) NOT NULL DEFAULT ''");}
if(!pdo_fieldexists('superman_creditmall_activity_clerks','password')) {pdo_query("ALTER TABLE ".tablename('superman_creditmall_activity_clerks')." ADD `password` varchar(20) NOT NULL DEFAULT ''");}
if(!pdo_fieldexists('superman_creditmall_activity_clerks','mobile')) {pdo_query("ALTER TABLE ".tablename('superman_creditmall_activity_clerks')." ADD `mobile` varchar(20) NOT NULL DEFAULT ''");}
if(!pdo_fieldexists('superman_creditmall_activity_clerks','openid')) {pdo_query("ALTER TABLE ".tablename('superman_creditmall_activity_clerks')." ADD `openid` varchar(50) NOT NULL DEFAULT ''");}
if(!pdo_fieldexists('superman_creditmall_activity_clerks','nickname')) {pdo_query("ALTER TABLE ".tablename('superman_creditmall_activity_clerks')." ADD `nickname` varchar(30) NOT NULL DEFAULT ''");}
if(!pdo_fieldexists('superman_creditmall_activity_clerks','id')) {pdo_query("ALTER TABLE ".tablename('superman_creditmall_activity_clerks')." ADD PRIMARY KEY (`id`)");}
pdo_query("CREATE TABLE IF NOT EXISTS `ims_superman_creditmall_activity_exchange` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`uniacid` int(11) NOT NULL DEFAULT '0' COMMENT '公众号id',
`title` varchar(100) NOT NULL COMMENT '物品名称',
`description` text NOT NULL COMMENT '描述信息',
`thumb` varchar(500) NOT NULL COMMENT '缩略图',
`type` tinyint(1) unsigned NOT NULL COMMENT '物品类型,1系统卡券,2微信呢卡券,3实物,4虚拟物品(未启用),5营销模块操作次数',
`extra` varchar(3000) NOT NULL DEFAULT '' COMMENT '兑换产品属性 卡券自增id',
`credit` int(10) unsigned NOT NULL COMMENT '兑换积分数量',
`credittype` varchar(10) NOT NULL COMMENT '兑换积分类型',
`pretotal` int(11) NOT NULL COMMENT '每个人最大兑换次数',
`num` int(11) NOT NULL COMMENT '已兑换礼品数量',
`total` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '总量',
`status` tinyint(3) unsigned NOT NULL DEFAULT '1' COMMENT '状态',
`starttime` int(10) unsigned NOT NULL,
`endtime` int(10) NOT NULL,
PRIMARY KEY (`id`),
KEY `ind_uniacid` (`uniacid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;
");
if(!pdo_fieldexists('superman_creditmall_activity_exchange','id')) {pdo_query("ALTER TABLE ".tablename('superman_creditmall_activity_exchange')." ADD
`id` int(11) NOT NULL AUTO_INCREMENT");}
if(!pdo_fieldexists('superman_creditmall_activity_exchange','uniacid')) {pdo_query("ALTER TABLE ".tablename('superman_creditmall_activity_exchange')." ADD `uniacid` int(11) NOT NULL DEFAULT '0' COMMENT '公众号id'");}
if(!pdo_fieldexists('superman_creditmall_activity_exchange','title')) {pdo_query("ALTER TABLE ".tablename('superman_creditmall_activity_exchange')." ADD `title` varchar(100) NOT NULL COMMENT '物品名称'");}
if(!pdo_fieldexists('superman_creditmall_activity_exchange','description')) {pdo_query("ALTER TABLE ".tablename('superman_creditmall_activity_exchange')." ADD `description` text NOT NULL COMMENT '描述信息'");}
if(!pdo_fieldexists('superman_creditmall_activity_exchange','thumb')) {pdo_query("ALTER TABLE ".tablename('superman_creditmall_activity_exchange')." ADD `thumb` varchar(500) NOT NULL COMMENT '缩略图'");}
if(!pdo_fieldexists('superman_creditmall_activity_exchange','type')) {pdo_query("ALTER TABLE ".tablename('superman_creditmall_activity_exchange')." ADD `type` tinyint(1) unsigned NOT NULL COMMENT '物品类型,1系统卡券,2微信呢卡券,3实物,4虚拟物品(未启用),5营销模块操作次数'");}
if(!pdo_fieldexists('superman_creditmall_activity_exchange','extra')) {pdo_query("ALTER TABLE ".tablename('superman_creditmall_activity_exchange')." ADD `extra` varchar(3000) NOT NULL DEFAULT '' COMMENT '兑换产品属性 卡券自增id'");}
if(!pdo_fieldexists('superman_creditmall_activity_exchange','credit')) {pdo_query("ALTER TABLE ".tablename('superman_creditmall_activity_exchange')." ADD `credit` int(10) unsigned NOT NULL COMMENT '兑换积分数量'");}
if(!pdo_fieldexists('superman_creditmall_activity_exchange','credittype')) {pdo_query("ALTER TABLE ".tablename('superman_creditmall_activity_exchange')." ADD `credittype` varchar(10) NOT NULL COMMENT '兑换积分类型'");}
if(!pdo_fieldexists('superman_creditmall_activity_exchange','pretotal')) {pdo_query("ALTER TABLE ".tablename('superman_creditmall_activity_exchange')." ADD `pretotal` int(11) NOT NULL COMMENT '每个人最大兑换次数'");}
if(!pdo_fieldexists('superman_creditmall_activity_exchange','num')) {pdo_query("ALTER TABLE ".tablename('superman_creditmall_activity_exchange')." ADD `num` int(11) NOT NULL COMMENT '已兑换礼品数量'");}
if(!pdo_fieldexists('superman_creditmall_activity_exchange','total')) {pdo_query("ALTER TABLE ".tablename('superman_creditmall_activity_exchange')." ADD `total` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '总量'");}
if(!pdo_fieldexists('superman_creditmall_activity_exchange','status')) {pdo_query("ALTER TABLE ".tablename('superman_creditmall_activity_exchange')." ADD `status` tinyint(3) unsigned NOT NULL DEFAULT '1' COMMENT '状态'");}
if(!pdo_fieldexists('superman_creditmall_activity_exchange','starttime')) {pdo_query("ALTER TABLE ".tablename('superman_creditmall_activity_exchange')." ADD `starttime` int(10) unsigned NOT NULL");}
if(!pdo_fieldexists('superman_creditmall_activity_exchange','endtime')) {pdo_query("ALTER TABLE ".tablename('superman_creditmall_activity_exchange')." ADD `endtime` int(10) NOT NULL");}
if(!pdo_fieldexists('superman_creditmall_activity_exchange','id')) {pdo_query("ALTER TABLE ".tablename('superman_creditmall_activity_exchange')." ADD PRIMARY KEY (`id`)");}
pdo_query("CREATE TABLE IF NOT EXISTS `ims_superman_creditmall_activity_stores` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`uniacid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '公众号id',
`business_name` varchar(50) NOT NULL DEFAULT '' COMMENT '店名',
`branch_name` varchar(50) NOT NULL DEFAULT '' COMMENT '分支名',
`category` varchar(255) NOT NULL DEFAULT '' COMMENT '类别',
`province` varchar(15) NOT NULL DEFAULT '' COMMENT '省',
`city` varchar(15) NOT NULL