SET FOREIGN_KEY_CHECKS=0;

CREATE TABLE `tg_admin` (
  `id` int(11) NOT NULL auto_increment,
  `username` varchar(55) NOT NULL,
  `password` varchar(55) NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;



INSERT INTO `tg_admin` VALUES (1, 'admin', 'admin');



CREATE TABLE `tg_common` (
  `id` int(11) NOT NULL auto_increment,
  `classname` varchar(55) NOT NULL,
  `content` text NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;



INSERT INTO `tg_common` VALUES (1, 'tour', '<p>如何玩转，请下次观看~</p>');
INSERT INTO `tg_common` VALUES (2, 'faqs', 'fdsfsdf');
INSERT INTO `tg_common` VALUES (3, 'thinkgroupon', '1fdsfds');
INSERT INTO `tg_common` VALUES (4, 'api', 'fdsfdsd');
INSERT INTO `tg_common` VALUES (5, 'subscribe', '邮件订阅');
INSERT INTO `tg_common` VALUES (6, 'feed', 'RSS订阅');
INSERT INTO `tg_common` VALUES (7, 'seller', '商务合作');
INSERT INTO `tg_common` VALUES (8, 'suggest', '意见反馈');
INSERT INTO `tg_common` VALUES (9, 'contact', ' 联系方式');
INSERT INTO `tg_common` VALUES (10, 'us', '关于1288');
INSERT INTO `tg_common` VALUES (11, 'job', '工作机会');
INSERT INTO `tg_common` VALUES (12, 'terms', '用户协议');
INSERT INTO `tg_common` VALUES (13, 'privacy', '<p>隐私声明s</p>');



CREATE TABLE `tg_contact` (
  `id` int(11) NOT NULL auto_increment,
  `grouponinfo_id` int(11) NOT NULL,
  `shopname` varchar(45) NOT NULL COMMENT '商家名称',
  `contact` varchar(45) NOT NULL COMMENT '联系人',
  `phone` int(11) NOT NULL COMMENT '电话',
  `msn` varchar(55) NOT NULL,
  `qq` int(11) NOT NULL COMMENT 'QQ',
  `email` varchar(255) NOT NULL,
  `address` varchar(255) NOT NULL COMMENT '地址',
  `website` varchar(255) NOT NULL COMMENT '网站地址',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;



CREATE TABLE `tg_grouponclass` (
  `id` int(11) NOT NULL auto_increment,
  `classname` varchar(55) NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;



INSERT INTO `tg_grouponclass` VALUES (1, '服饰');
INSERT INTO `tg_grouponclass` VALUES (2, '化妆品');



CREATE TABLE `tg_grouponinfo` (
  `id` int(11) NOT NULL auto_increment,
  `grouponclass_id` int(11) NOT NULL,
  `title` varchar(55) NOT NULL,
  `content` varchar(255) NOT NULL,
  `count_person` int(11) NOT NULL,
  `price` int(11) NOT NULL,
  `rebate` int(11) NOT NULL COMMENT '折扣',
  `start_time` int(11) NOT NULL,
  `end_time` int(11) NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;



CREATE TABLE `tg_money` (
  `id` int(11) NOT NULL auto_increment,
  `users_id` int(11) NOT NULL,
  `money` int(11) NOT NULL COMMENT '金额',
  `money_type` int(11) NOT NULL COMMENT '1为充值,2为消费',
  `pubtime` int(11) NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;



CREATE TABLE `tg_rss` (
  `id` int(11) NOT NULL auto_increment,
  `email` varchar(45) NOT NULL,
  `city_id` int(11) NOT NULL default '3' COMMENT '默认全国为3',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;



CREATE TABLE `tg_seller` (
  `id` int(11) NOT NULL auto_increment,
  `name` varchar(45) NOT NULL COMMENT '姓名',
  `contact` varchar(45) NOT NULL COMMENT '联系方式',
  `shop_info` text NOT NULL COMMENT '团购信息',
  `pubtime` int(11) NOT NULL COMMENT '时间',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;



CREATE TABLE `tg_seo` (
  `id` int(11) NOT NULL auto_increment,
  `seo_page_address` varchar(55) NOT NULL COMMENT '位置',
  `seo_title` varchar(55) NOT NULL COMMENT 'seo title',
  `seo_keywords` varchar(255) NOT NULL COMMENT 'seo内容',
  `seo_description` varchar(255) NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;



INSERT INTO `tg_seo` VALUES (1, 'index', 'thinkgroupon团购网 - 今日团购|免费团购|全国站购物|全国站团购|全国站打折', 'thinkgroupon团购网, 全国站,  全国站1288团购网，全国站购物，全国站团购，全国站打折，团购，打折，精品消费，购物指南，消费指南', '今日团购|免费团购|全国站购物|全国站团购|全国站打折');
INSERT INTO `tg_seo` VALUES (6, 'list.htm', 'fsdfds', '1231ssssss', '3123u');



CREATE TABLE `tg_setting` (
  `id` int(11) NOT NULL auto_increment,
  `site_name` varchar(55) NOT NULL,
  `domain` varchar(255) NOT NULL,
  `create_time` int(11) NOT NULL,
  `email` varchar(55) NOT NULL,
  `logo` varchar(255) NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;



INSERT INTO `tg_setting` VALUES (1, 'http://www.thinkgroupon.com', 'http://www.thinkgroupon.com', 1285862400, 'http://www.thinkgroupon.com', 'http://www.thinkgroupon.com');



CREATE TABLE `tg_shop` (
  `id` int(11) NOT NULL auto_increment,
  `users_id` int(11) NOT NULL COMMENT '用户ID',
  `grouponinfo_id` int(11) NOT NULL COMMENT '团购商品ID',
  `shop_name` varchar(55) NOT NULL COMMENT '商品名称',
  `count` int(11) NOT NULL COMMENT '数量',
  `price` int(11) NOT NULL COMMENT '价格',
  `remark` text NOT NULL COMMENT '附加留言',
  `pubtime` int(11) NOT NULL COMMENT '提交时间',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;


CREATE TABLE `tg_users` (
  `id` int(11) NOT NULL auto_increment,
  `email` varchar(50) NOT NULL,
  `username` varchar(50) NOT NULL,
  `password` varchar(255) NOT NULL,
  `mobile` int(11) default NULL,
  `city` int(11) default NULL,
  `ip` int(11) NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;