<?php
$installSql = <<<sql
DROP TABLE IF EXISTS `ims_mihua_sq_account`;
CREATE TABLE `ims_mihua_sq_account` (
`cash_id` int(11) NOT NULL AUTO_INCREMENT,
`uniacid` int(11) DEFAULT NULL,
`shop_id` int(11) DEFAULT NULL,
`username` varchar(64) DEFAULT NULL,
`money` int(11) DEFAULT NULL,
`addtime` int(11) DEFAULT NULL,
`status` tinyint(1) DEFAULT '0' COMMENT '0未审核1通过2拒绝',
`reason` text,
`account` varchar(64) DEFAULT NULL,
`bank_name` varchar(128) DEFAULT NULL,
`bank_num` varchar(32) DEFAULT NULL,
`bank_branch` varchar(128) DEFAULT NULL,
`bank_realname` varchar(64) DEFAULT NULL,
`ordersn` varchar(20) DEFAULT NULL,
`paytype` tinyint(1) DEFAULT NULL COMMENT '1微信2支付宝3银行卡',
`alipay_account` varchar(128) DEFAULT NULL,
`alipay_name` varchar(64) DEFAULT NULL,
`transfer` decimal(10,2) DEFAULT '0.00' COMMENT '手续费',
`amount` decimal(10,2) DEFAULT '0.00' COMMENT '提现金额',
`admin_id` int(11) DEFAULT NULL,
`openid` varchar(100) NOT NULL,
`checktime` int(11) DEFAULT NULL COMMENT '处理申请时间',
`check_admin` int(11) DEFAULT NULL COMMENT '处理人',
`type` tinyint(3) DEFAULT NULL COMMENT '1用户提现 2商户提现',
PRIMARY KEY (`cash_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
DROP TABLE IF EXISTS `ims_mihua_sq_address`;
CREATE TABLE `ims_mihua_sq_address` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`openid` varchar(50) NOT NULL,
`realname` varchar(20) NOT NULL,
`mobile` varchar(11) NOT NULL,
`province` varchar(30) NOT NULL,
`city` varchar(30) NOT NULL,
`area` varchar(30) NOT NULL,
`address` varchar(300) NOT NULL,
`isdefault` tinyint(3) unsigned NOT NULL DEFAULT '0',
`deleted` tinyint(3) unsigned NOT NULL DEFAULT '0',
`uniacid` int(11) DEFAULT '0',
`lat` varchar(255) DEFAULT '',
`lng` varchar(255) DEFAULT '',
`inco` varchar(300) DEFAULT NULL COMMENT '标签',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
DROP TABLE IF EXISTS `ims_mihua_sq_admin`;
CREATE TABLE `ims_mihua_sq_admin` (
`admin_id` int(11) NOT NULL AUTO_INCREMENT,
`uniacid` int(11) DEFAULT NULL,
`admin_name` varchar(100) DEFAULT NULL,
`nickname` varchar(100) DEFAULT NULL,
`passport` varchar(50) DEFAULT NULL,
`password` varchar(200) DEFAULT NULL,
`avatar` varchar(200) DEFAULT NULL,
`openid` varchar(100) NOT NULL,
`addtime` int(11) DEFAULT '0',
`status` tinyint(1) DEFAULT '0' COMMENT '0开启 1暂停',
`msg_flag` tinyint(1) DEFAULT '0' COMMENT '0=>发送通知,1=>不发送通知',
`mobile` char(15) DEFAULT NULL,
`admin_uid` int(11) DEFAULT NULL,
PRIMARY KEY (`admin_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
DROP TABLE IF EXISTS `ims_mihua_sq_adv`;
CREATE TABLE `ims_mihua_sq_adv` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`uniacid` int(11) DEFAULT '0',
`advname` varchar(50) DEFAULT '',
`link` varchar(255) NOT NULL DEFAULT '',
`thumb` varchar(255) DEFAULT '',
`displayorder` int(11) DEFAULT '0',
`enabled` int(11) DEFAULT '0',
`type` text COMMENT '1首页,2首页中部,3首页底部,4拼团,5秒杀,6首单,7买单,8同城',
`add_time` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
KEY `indx_uniacid` (`uniacid`),
KEY `indx_enabled` (`enabled`),
KEY `indx_displayorder` (`displayorder`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
DROP TABLE IF EXISTS `ims_mihua_sq_area`;
CREATE TABLE `ims_mihua_sq_area` (
`area_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
`uniacid` int(11) DEFAULT NULL,
`city_id` smallint(5) DEFAULT '0',
`parent_id` int(11) DEFAULT NULL,
`area_name` varchar(32) DEFAULT NULL,
`orderby` tinyint(3) DEFAULT '100',
`is_hot` tinyint(1) DEFAULT '0',
PRIMARY KEY (`area_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
DROP TABLE IF EXISTS `ims_mihua_sq_balance`;
CREATE TABLE `ims_mihua_sq_balance` (
`balance_id` int(11) NOT NULL AUTO_INCREMENT,
`uniacid` int(10) unsigned NOT NULL,
`money` float(10,2) DEFAULT '0.00',
`uid` int(11) DEFAULT '0',
`addtime` int(11) DEFAULT '0',
`status` tinyint(1) DEFAULT '0' COMMENT '0=>未支付,1=>支付完成',
`openid` varchar(100) DEFAULT NULL,
PRIMARY KEY (`balance_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
DROP TABLE IF EXISTS `ims_mihua_sq_black`;
CREATE TABLE `ims_mihua_sq_black` (
`black_id` int(11) NOT NULL AUTO_INCREMENT,
`uniacid` int(10) unsigned NOT NULL,
`uid` varchar(50) DEFAULT NULL,
`createtime` int(11) NOT NULL,
PRIMARY KEY (`black_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
DROP TABLE IF EXISTS `ims_mihua_sq_cart`;
CREATE TABLE `ims_mihua_sq_cart` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`uniacid` int(10) unsigned NOT NULL,
`goodsid` int(11) NOT NULL,
`goodstype` tinyint(1) NOT NULL DEFAULT '1',
`from_user` varchar(50) NOT NULL,
`total` int(10) unsigned NOT NULL,
`optionid` int(10) DEFAULT '0',
`marketprice` decimal(10,2) DEFAULT '0.00',
PRIMARY KEY (`id`),
KEY `idx_openid` (`from_user`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
DROP TABLE IF EXISTS `ims_mihua_sq_cash`;
CREATE TABLE `ims_mihua_sq_cash` (
`cash_id` int(11) NOT NULL AUTO_INCREMENT,
`cash_ordersn` varchar(20) NOT NULL,
`cash_type` tinyint(1) DEFAULT '1' COMMENT '操作类别(1抢红包,2打赏)',
`create_time` int(11) NOT NULL COMMENT '该记录创建时间',
`openid` varchar(50) NOT NULL DEFAULT '用户openid',
`from_openid` varchar(50) NOT NULL DEFAULT '从哪个用户的opneid得到钱',
`uniacid` int(11) DEFAULT NULL,
`type_id` int(11) DEFAULT NULL,
`amount` decimal(10,2) NOT NULL COMMENT '金额',
`status` tinyint(1) DEFAULT '1' COMMENT '状态(0.付款中,1:成功)',
`red_id` int(11) NOT NULL,
PRIMARY KEY (`cash_id`),
UNIQUE KEY `id` (`cash_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
DROP TABLE IF EXISTS `ims_mihua_sq_channel`;
CREATE TABLE `ims_mihua_sq_channel` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`weid` int(11) NOT NULL,
`name` varchar(30) NOT NULL,
`thumb` varchar(100) NOT NULL,
`sharetitle` varchar(50) NOT NULL,
`sharethumb` varchar(100) NOT NULL,
`sharedes` varchar(100) NOT NULL,
`displayorder` int(11) NOT NULL,
`canrelease` tinyint(1) NOT NULL DEFAULT '1',
`isshenhe` tinyint(1) NOT NULL DEFAULT '1',
`iscang` tinyint(1) NOT NULL,
`minscore` smallint(6) NOT NULL,
`isneedpay` tinyint(1) NOT NULL,
`needpay` decimal(10,2) NOT NULL,
`templateid` smallint(6) NOT NULL,
`detailtemplateid` smallint(6) NOT NULL,
`module` tinyint(4) NOT NULL,
`autourl` varchar(200) NOT NULL,
`listhtml` longtext NOT NULL,
`detailhtml` longtext NOT NULL,
`defult_list` tinyint(1) NOT NULL DEFAULT '1' COMMENT '1使用默认列表页 2自定义',
`defult_detail` tinyint(1) NOT NULL DEFAULT '1' COMMENT '1使用默认详情页 2自定义',
`ison` tinyint(1) NOT NULL DEFAULT '1',
`zdprice` decimal(10,2) NOT NULL DEFAULT '0.00',
`haibaobg` varchar(100) NOT NULL,
`template` varchar(20) NOT NULL,
`template2` varchar(20) NOT NULL,
`template3` varchar(20) NOT NULL,
`fid` smallint(6) NOT NULL,
`bgparam` varchar(10240) NOT NULL,
`show_location` tinyint(1) DEFAULT '1' COMMENT '1显示发布位置 2不显示',
`show_comment` tinyint(1) DEFAULT '1' COMMENT '1开启评论 2不开启',
`minusscore` smallint(6) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
DROP TABLE IF EXISTS `ims_mihua_sq_chat`;
CREATE TABLE `ims_mihua_sq_chat` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`weid` int(11) NOT NULL,
`openid` varchar(100) NOT NULL,
`toopenid` varchar(100) NOT NULL,
`content` varchar(255) NOT NULL,
`time` int(11) NOT NULL,
`nickname` varchar(50) NOT NULL,
`avatar` varchar(200) NOT NULL,
`type` tinyint(1) NOT NULL,
`hasread` tinyint(1) NOT NULL,
`deleteid` int(11) DEFAULT '0' COMMENT '删除者id',
`userid` varchar(100) DEFAULT NULL,
`user1` int(11) DEFAULT NULL COMMENT '标识发送消息人',
`user2` int(11) DEFAULT NULL COMMENT '标识接收消息人',
`flag` tinyint(3) DEFAULT '0