-- 
-- 表的结构 `admin`
-- 
CREATE TABLE `{$dbprefix}admin` (
  `id` int(11) NOT NULL auto_increment,
  `account` varchar(20) NOT NULL,
  `password` varchar(32) NOT NULL,
  `name` varchar(30) NOT NULL,
  `phone` varchar(30) NOT NULL,
  `qq` varchar(15) NOT NULL,
  `date` datetime NOT NULL,
  `sex` varchar(2) NOT NULL,
  `email` varchar(100) NOT NULL,
  `address` varchar(400) NOT NULL,
  `remark` varchar(200) default NULL,
  `status` varchar(20) NOT NULL,
  `isdel` tinyint(4) NOT NULL default '0',
  PRIMARY KEY  (`id`),
  KEY `account` (`account`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=0 ;

-- 
-- 表的结构 `admin_log`
-- 


CREATE TABLE `{$dbprefix}admin_log` (
  `id` int(11) NOT NULL auto_increment,
  `content` varchar(400) NOT NULL,
  `model` varchar(50) NOT NULL,
  `adminId` int(11) NOT NULL,
  `ip` varchar(50) NOT NULL,
  `date` datetime NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=0 ;

-- 
-- 表的结构 `admin_log`
-- 


CREATE TABLE IF NOT EXISTS `{$dbprefix}appmoney` (
  `id` int(11) NOT NULL auto_increment,
  `memberId` int(11) NOT NULL,
  `bank` varchar(50) NOT NULL,
  `name` varchar(50) NOT NULL,
  `account` varchar(50) NOT NULL,
  `contact` varchar(50) NOT NULL,
  `phone` varchar(30) NOT NULL,
  `mobile` varchar(20) NOT NULL,
  `remark` varchar(200) NOT NULL,
  `date` datetime NOT NULL,
  `value` int(11) NOT NULL,
  `status` varchar(20) NOT NULL,
  `isdel` tinyint(4) NOT NULL default '0',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=2 ;

-- --------------------------------------------------------

-- 
-- 表的结构 `area`
-- 

CREATE TABLE IF NOT EXISTS `{$dbprefix}area` (
  `id` int(11) NOT NULL auto_increment,
  `cityId` int(11) NOT NULL,
  `name` varchar(20) NOT NULL,
  `englishName` varchar(30) NOT NULL,
  `remark` varchar(200) NOT NULL,
  `status` varchar(20) NOT NULL,
  `displayOrder` int(11) NOT NULL,
  `isdel` tinyint(4) NOT NULL default '0',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=38 ;

-- --------------------------------------------------------

-- 
-- 表的结构 `article`
-- 

CREATE TABLE IF NOT EXISTS `{$dbprefix}article` (
  `id` int(11) NOT NULL auto_increment,
  `title` varchar(50) NOT NULL,
  `content` text NOT NULL,
  `cover` varchar(100) NOT NULL,
  `typeId` int(11) NOT NULL,
  `date` datetime NOT NULL,
  `status` varchar(20) NOT NULL,
  `isdel` tinyint(1) NOT NULL default '0',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=12 ;

-- --------------------------------------------------------

-- 
-- 表的结构 `city`
-- 

CREATE TABLE IF NOT EXISTS `{$dbprefix}city` (
  `id` int(11) NOT NULL auto_increment,
  `provinceId` int(11) NOT NULL,
  `name` varchar(20) NOT NULL,
  `englishName` varchar(30) NOT NULL,
  `remark` varchar(200) NOT NULL,
  `status` varchar(20) NOT NULL,
  `displayOrder` int(11) NOT NULL,
  `isdel` tinyint(1) NOT NULL default '0',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=10 ;


-- --------------------------------------------------------

-- 
-- 表的结构 `comment_ktv`
-- 

CREATE TABLE IF NOT EXISTS `{$dbprefix}comment_ktv` (
  `id` int(11) NOT NULL auto_increment,
  `environmental` float NOT NULL,
  `service` float NOT NULL,
  `ktvId` int(11) NOT NULL,
  `sound` float NOT NULL,
  `memberId` int(4) NOT NULL,
  `date` varchar(30) NOT NULL,
  `title` varchar(100) NOT NULL,
  `content` text NOT NULL,
  `isdel` int(4) NOT NULL default '0',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=21 ;

-- --------------------------------------------------------



-- 
-- 表的结构 `finance`
-- 

CREATE TABLE IF NOT EXISTS `{$dbprefix}finance` (
  `id` int(11) NOT NULL auto_increment,
  `memberId` int(11) NOT NULL,
  `type` varchar(20) NOT NULL,
  `date` datetime NOT NULL,
  `value` int(11) NOT NULL,
  `relTableName` varchar(50) NOT NULL,
  `relId` int(11) NOT NULL,
  `remark` varchar(200) NOT NULL,
  `status` varchar(20) NOT NULL,
  `isdel` tinyint(4) NOT NULL default '0',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=13 ;

-- --------------------------------------------------------

-- 
-- 表的结构 `ktv`
-- 

CREATE TABLE IF NOT EXISTS `{$dbprefix}ktv` (
  `id` int(11) NOT NULL auto_increment,
  `name` varchar(100) NOT NULL,
  `shortName` varchar(50) NOT NULL,
  `enName` varchar(50) NOT NULL,
  `areaId` int(11) NOT NULL,
  `levelId` int(11) NOT NULL,
  `landmarkId` int(11) NOT NULL,
  `shopareaId` int(11) NOT NULL,
  `phone` varchar(100) NOT NULL,
  `address` varchar(200) NOT NULL,
  `ktvtype` int(11) NOT NULL,
  `service` varchar(100) NOT NULL,
  `opentime` varchar(100) NOT NULL,
  `closetime` varchar(100) NOT NULL,
  `subtitle` varchar(100) NOT NULL,
  `farelist` text NOT NULL,
  `traffic` text NOT NULL,
  `baiduMapX` varchar(20) default NULL,
  `baiduMapY` varchar(20) default NULL,
  `title` varchar(200) NOT NULL,
  `keywords` varchar(100) NOT NULL,
  `discount` varchar(100) NOT NULL,
  `onsale` varchar(100) NOT NULL,
  `cover` varchar(200) NOT NULL,
  `listTitle` varchar(10) default NULL,
  `description` varchar(300) NOT NULL,
  `score` int(11) NOT NULL,
  `status` varchar(20) NOT NULL,
  `isdel` tinyint(4) NOT NULL default '0',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=35 ;

-- --------------------------------------------------------

-- 
-- 表的结构 `ktv_level`
-- 

CREATE TABLE IF NOT EXISTS `{$dbprefix}ktv_level` (
  `id` int(11) NOT NULL auto_increment,
  `type` varchar(10) NOT NULL,
  `name` varchar(20) NOT NULL,
  `picture` varchar(100) NOT NULL,
  `remark` varchar(200) NOT NULL,
  `status` varchar(20) NOT NULL,
  `displayOrder` int(11) NOT NULL,
  `isdel` tinyint(4) NOT NULL default '0',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=16 ;

-- --------------------------------------------------------

-- 
-- 表的结构 `ktv_room`
-- 

CREATE TABLE IF NOT EXISTS `{$dbprefix}ktv_room` (
  `id` int(11) NOT NULL auto_increment,
  `ktvId` int(11) NOT NULL,
  `name` varchar(50) NOT NULL,
  `size` int(11) NOT NULL,
  `seating` varchar(11) NOT NULL COMMENT '可容纳人数',
  `remark` text NOT NULL,
  `discount` varchar(200) NOT NULL COMMENT '优惠',
  `min_price` int(4) NOT NULL COMMENT '最低消费',
  `sort` int(20) NOT NULL default '0' COMMENT '排序',
  `room_count` int(11) NOT NULL,
  `status` varchar(20) NOT NULL,
  `photo` varchar(200) NOT NULL,
  `isdel` tinyint(4) NOT NULL default '0',
  PRIMARY KEY  (`id`),
  KEY `tr_hotelId` (`ktvId`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=0 ;

-- --------------------------------------------------------

-- 
-- 表的结构 `ktv_service`
-- 

CREATE TABLE IF NOT EXISTS `{$dbprefix}ktv_service` (
  `id` int(11) NOT NULL auto_increment,
  `name` varchar(50) NOT NULL,
  `date` datetime NOT NULL,
  `status` varchar(10) NOT NULL,
  `isdel` int(11) NOT NULL default '0',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=13 ;

-- --------------------------------------------------------

-- 
-- 表的结构 `ktv_times`
-- 

CREATE TABLE IF NOT EXISTS `{$dbprefix}ktv_times` (
  `id` int(11) NOT NULL auto_increment,
  `name` varchar(50) NOT NULL,
  `hotelId` int(11) NOT NULL,
  `begin_time` varchar(50) NOT NULL,
  `end_time` varchar(50) NOT NULL,
  `isdel` enum('0','1') NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=54 ;

-- --------------------------------------------------------

-- 
-- 表的结构 `ktv_type`
-- 

CREATE TABLE IF NOT EXISTS `{$dbprefix}ktv_type` (
  `id` int(11) NOT NULL auto_increment,
  `name` varchar(20) NOT NULL,
  `isdel` enum('0','1') NOT NULL default '0',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=27 ;

-- --------------------------------------------------------

-- 
-- 表的结构 `landmark`
-- 

CREATE TABLE IF NOT EXISTS `{$dbprefix}landmark` (
  `id` int(11) NOT NULL auto_increment,
  `areaId` int(11) NOT NULL,
  `category` varchar(20) NOT NULL,
  `name` varchar(20) NOT NULL,
  `englishName` varchar(30) NOT NULL,
  `remark` varchar(200) NOT NULL,
  `status` varchar(20) NOT NULL,
  `displayOrder` int(11) NOT NULL,
  `isdel` tinyint(4) NOT NULL default '0',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=64 ;

-- --------------------------------------------------------

-- 
-- 表的结构 `member`
-- 

CREATE TABLE IF NOT EXISTS `{$dbprefix}member` (
  `id` int(11) NOT NULL auto_increment,
  `account` varchar(20) NOT NULL,
  `password` varchar(32) NOT NULL,
  `name` varchar(30) NOT NULL,
  `sex` varchar(2) NOT NULL,
  `mobile` varchar(15) NOT NULL,
  `qq` varchar(15) NOT NULL,
  `phone` varchar(30) NOT NULL,
  `email` varchar(100) NOT NULL,
  `address` varchar(400) NOT NULL,
  `company` varchar(300) NOT NULL,
  `postcode` varchar(20) NOT NULL,
  `type` varchar(10) NOT NULL,
  `siteKey` varchar(20) default NULL,
  `hotelReturn` decimal(18,2) NOT NULL default '0.00',
  `status` varchar(20) NOT NULL,
  `nickName` varchar(50) NOT NULL,
  `areaId` int(11) NOT NULL,
  `trueName` varchar(50) NOT NULL,
  `shopareaId` int(11) NOT NULL,
  `head` varchar(250) NOT NULL,
  `remark` varchar(200) default NULL,
  `date` datetime NOT NULL,
  `isdel` tinyint(4) NOT NULL default '0',
  PRIMARY KEY  (`id`),
  KEY `account` (`account`),
  KEY `type` (`type`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=6 ;

-- --------------------------------------------------------

-- 
-- 表的结构 `nopay`
-- 

CREATE TABLE IF NOT EXISTS `{$dbprefix}nopay` (
  `id` int(11) NOT NULL auto_increment,
  `categoryname` varchar(20) NOT NULL,
  `categoryid` int(11) NOT NULL,
  `date` datetime NOT NULL,
  `isdel` enum('0','1') NOT NULL default '0',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COMMENT='禁止使用支付方式的表' AUTO_INCREMENT=36 ;

-- --------------------------------------------------------

-- 
-- 表的结构 `order_ktv`
-- 

CREATE TABLE IF NOT EXISTS `{$dbprefix}order_ktv` (
  `id` int(11) NOT NULL auto_increment,
  `code` varchar(30) NOT NULL,
  `times` varchar(50) NOT NULL,
  `begin_time` varchar(50) NOT NULL,
  `end_time` varchar(50) NOT NULL,
  `numbers` int(4) NOT NULL,
  `ktvId` int(4) NOT NULL,
  `room_id` int(8) NOT NULL,
  `remark` varchar(250) NOT NULL,
  `other_name` varchar(50) NOT NULL,
  `other_sex` varchar(4) NOT NULL,
  `other_phone` varchar(15) NOT NULL,
  `adminId` int(11) NOT NULL,
  `memberId` int(11) NOT NULL,
  `price` int(6) NOT NULL,
  `status` varchar(10) NOT NULL,
  `date` date NOT NULL,
  `isdel` int(11) NOT NULL default '0',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=4 ;

-- --------------------------------------------------------

-- 
-- 表的结构 `pay`
-- 

CREATE TABLE IF NOT EXISTS `{$dbprefix}pay` (
  `id` int(11) NOT NULL auto_increment,
  `name` varchar(20) NOT NULL,
  `ch_name` varchar(30) NOT NULL COMMENT '中文名',
  `account` varchar(50) NOT NULL,
  `partnerid` varchar(50) NOT NULL,
  `key` varchar(50) NOT NULL,
  `modular` varchar(200) NOT NULL COMMENT '开启支付模块',
  `noPay` varchar(250) NOT NULL COMMENT '不需要支付方式的id 以序列化后的字符串表示',
  `return` varchar(250) NOT NULL COMMENT '支付成功返回的页面',
  `deposit` varchar(200) NOT NULL default '0' COMMENT '定金 0为全额',
  `date` datetime NOT NULL,
  `status` varchar(10) NOT NULL ,
  `isdel` varchar(10) NOT NULL default '0',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=0 ;

-- --------------------------------------------------------

-- 
-- 表的结构 `photo`
-- 

CREATE TABLE IF NOT EXISTS `{$dbprefix}photo` (
  `id` int(11) NOT NULL auto_increment,
  `uploader` varchar(10) NOT NULL,
  `uploaderId` int(11) NOT NULL,
  `categoryName` varchar(10) NOT NULL,
  `categoryRelId` int(11) NOT NULL,
  `typeRelId` int(11) NOT NULL,
  `name` varchar(100) NOT NULL,
  `content` varchar(200) NOT NULL,
  `width` int(11) NOT NULL,
  `height` int(11) NOT NULL,
  `orderCode` varchar(20) NOT NULL,
  `takeMoney` int(11) NOT NULL,
  `status` varchar(20) NOT NULL,
  `isdel` tinyint(4) NOT NULL default '0',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=34296 ;

-- --------------------------------------------------------

-- 
-- 表的结构 `price_ktv_room`
-- 

CREATE TABLE IF NOT EXISTS `{$dbprefix}price_ktv_room` (
  `id` int(11) NOT NULL auto_increment,
  `dateofweek` varchar(20) NOT NULL,
  `roomId` int(11) NOT NULL,
  `name` varchar(100) NOT NULL COMMENT '（已改）timesid （对应ktv_times 表）',
  `price` decimal(9,2) NOT NULL,
  `begin_time` int(11) NOT NULL,
  `end_time` int(11) NOT NULL,
  `isFull` tinyint(1) default '0',
  `member_price` decimal(9,2) NOT NULL,
  `remark` varchar(200) default NULL,
  `isdel` tinyint(4) NOT NULL default '0',
  PRIMARY KEY  (`id`),
  KEY `tpr_roomId` (`roomId`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=145 ;

-- --------------------------------------------------------

-- 
-- 表的结构 `province`
-- 

CREATE TABLE IF NOT EXISTS `{$dbprefix}province` (
  `id` int(11) NOT NULL auto_increment,
  `name` varchar(20) NOT NULL,
  `englishName` varchar(30) NOT NULL,
  `remark` varchar(200) NOT NULL,
  `status` varchar(20) NOT NULL,
  `displayOrder` int(11) NOT NULL,
  `isdel` tinyint(1) NOT NULL default '0',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=8 ;

-- --------------------------------------------------------

-- 
-- 表的结构 `question`
-- 

CREATE TABLE IF NOT EXISTS `{$dbprefix}question` (
  `id` int(11) NOT NULL auto_increment,
  `memberId` int(11) NOT NULL,
  `categoryName` varchar(10) NOT NULL,
  `categoryRelId` int(11) NOT NULL,
  `title` varchar(200) NOT NULL,
  `content` varchar(500) NOT NULL,
  `adminId` int(11) default '0',
  `adminReply` varchar(500) default NULL,
  `adminReplyDate` varchar(21) default NULL,
  `viewNum` int(11) NOT NULL,
  `date` datetime NOT NULL,
  `status` varchar(20) NOT NULL,
  `isdel` tinyint(4) NOT NULL default '0',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=117 ;

-- --------------------------------------------------------

-- --------------------------------------------------------

-- 
-- 表的结构 `shoparea`
-- 

CREATE TABLE IF NOT EXISTS `{$dbprefix}shoparea` (
  `id` int(11) NOT NULL auto_increment,
  `areaId` int(11) NOT NULL,
  `type` varchar(20) NOT NULL,
  `name` varchar(20) NOT NULL,
  `englishName` varchar(30) NOT NULL,
  `remark` varchar(200) NOT NULL,
  `status` varchar(20) NOT NULL,
  `displayOrder` int(11) NOT NULL,
  `isdel` tinyint(4) NOT NULL default '0',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=127 ;

-- --------------------------------------------------------

-- 
-- 表的结构 `trace`
-- 

CREATE TABLE IF NOT EXISTS `{$dbprefix}trace` (
  `id` int(11) NOT NULL auto_increment,
  `relTable` varchar(50) NOT NULL,
  `relId` int(11) NOT NULL,
  `adminId` int(11) NOT NULL,
  `adminName` varchar(50) NOT NULL,
  `adminAccount` varchar(50) NOT NULL,
  `content` varchar(200) NOT NULL,
  `statusRemark` varchar(50) NOT NULL,
  `date` datetime NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=30 ;

-- --------------------------------------------------------

-- 
-- 表的结构 `type`
-- 

CREATE TABLE IF NOT EXISTS `{$dbprefix}type` (
  `id` int(11) NOT NULL auto_increment,
  `name` varchar(20) NOT NULL,
  `rewrite` varchar(20) NOT NULL,
  `category` varchar(20) NOT NULL,
  `sort` varchar(20) NOT NULL,
  `date` datetime NOT NULL,
  `status` varchar(20) NOT NULL,
  `isdel` tinyint(1) NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=14 ;

-- --------------------------------------------------------
