

CREATE TABLE `zjmanagelogs` (
  `id` int(11) NOT NULL auto_increment COMMENT '主键',
  `user` char(100) NOT NULL COMMENT '操作者',
  `descript` char(250) NOT NULL COMMENT '操作行为',
  `datetime` datetime NOT NULL COMMENT '操作时间',
  `comment` varchar(250) NOT NULL COMMENT '注释',
  PRIMARY KEY  (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='后台操作日志' AUTO_INCREMENT=1 ;



CREATE TABLE `zjmoneylogs` (
  `id` int(11) NOT NULL auto_increment COMMENT '主键',
  `author` int(8) NOT NULL COMMENT '操作者ID',
  `goldcontent` int(8) NOT NULL COMMENT '金币操作数目',
  `silvercontent` int(8) NOT NULL COMMENT '银币操作数目',
  `moneyactid` int(8) NOT NULL COMMENT '目标ID',
  `datetime` datetime NOT NULL COMMENT '操作时间',
  `descript` varchar(100) NOT NULL COMMENT '操作说明',
  `comment` varchar(200) NOT NULL COMMENT '注释',
  PRIMARY KEY  (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='金币操作日志' AUTO_INCREMENT=1 ;



CREATE TABLE `zjnewmessages` (
  `id` int(11) NOT NULL auto_increment COMMENT '主键',
  `userid` int(8) NOT NULL COMMENT '作者ID',
  `themesid` int(8) NOT NULL COMMENT '主题ID',
  `adds` varchar(50) NOT NULL COMMENT '评分',
  `descript` text NOT NULL COMMENT '内容',
  `datetime` datetime NOT NULL COMMENT '发布时间',
  PRIMARY KEY  (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='留言列表' AUTO_INCREMENT=1 ;



CREATE TABLE `zjnewpublish` (
  `id` int(11) NOT NULL auto_increment,
  `name` char(200) NOT NULL,
  `author` char(50) NOT NULL,
  `descript` text NOT NULL,
  `datetime` datetime NOT NULL,
  `views` int(8) NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='系统公告新闻' AUTO_INCREMENT=1 ;




CREATE TABLE `zjnewsabout` (
  `id` int(11) NOT NULL auto_increment,
  `descript` text NOT NULL,
  `name` char(200) NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='单编文章' AUTO_INCREMENT=1 ;



CREATE TABLE `zjphonesbrand` (
  `phonebrandid` int(11) NOT NULL auto_increment COMMENT '主键',
  `phonebrandname` char(100) NOT NULL COMMENT '手机品牌名称',
  `comment` varchar(250) NOT NULL COMMENT '注释',
  PRIMARY KEY  (`phonebrandid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='手机品牌列举' AUTO_INCREMENT=1 ;



CREATE TABLE `zjphonesmodule` (
  `moduleid` int(11) NOT NULL auto_increment,
  `modulename` char(100) NOT NULL COMMENT '手机型号名称',
  `brandid` int(8) NOT NULL COMMENT '手机品牌 ZJPhonesBrand',
  `scrid` int(8) NOT NULL COMMENT '手机屏幕 ZJPhonesScreen',
  `osid` int(8) NOT NULL COMMENT '手机操作系统 ZJPhonesOS',
  `comment` varchar(250) NOT NULL COMMENT '注释',
  PRIMARY KEY  (`moduleid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='手机型号列举' AUTO_INCREMENT=1 ;




CREATE TABLE `zjphonesos` (
  `osid` int(11) NOT NULL auto_increment COMMENT '主键',
  `osname` char(100) NOT NULL COMMENT '手机操作系统名称',
  `enterprisename` varchar(100) NOT NULL COMMENT '手机操作系统生产商名称',
  `vernum` varchar(100) NOT NULL COMMENT '手机操作系统版本号',
  `comment` varchar(250) NOT NULL COMMENT '注释',
  PRIMARY KEY  (`osid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='手机操作系统枚举' AUTO_INCREMENT=1 ;



CREATE TABLE `zjphonesscreen` (
  `scrid` int(11) NOT NULL auto_increment COMMENT '主键',
  `scrname` char(100) NOT NULL COMMENT '手机屏幕大小名称',
  `scrwidth` int(8) NOT NULL COMMENT '手机屏幕大小宽度',
  `scrheight` int(8) NOT NULL COMMENT '手机屏幕大小高度',
  `scrbit` int(8) NOT NULL COMMENT '手机屏幕大小位深',
  `comment` varchar(250) NOT NULL COMMENT '注释',
  PRIMARY KEY  (`scrid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='手机屏幕枚举' AUTO_INCREMENT=1 ;



CREATE TABLE `zjthemesgroup` (
  `id` int(11) NOT NULL auto_increment COMMENT '主键',
  `up` int(8) NOT NULL COMMENT '二级分类',
  `name` char(200) NOT NULL COMMENT '主题名称',
  `comment` varchar(250) NOT NULL COMMENT '注释',
  PRIMARY KEY  (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='主题分类' AUTO_INCREMENT=1 ;



INSERT INTO `zjthemesgroup` (`id`, `up`, `name`, `comment`) VALUES 
(1, 0, 'Abstract', ''),
(2, 0, 'Anime', ''),
(3, 0, 'Auto & Vehicles', ''),
(5, 0, 'Babes', ''),
(6, 0, 'Bollywood', ''),
(7, 0, 'Comedy', ''),
(8, 0, 'Designs', ''),
(9, 0, 'Drawn/Cartoons', ''),
(10, 0, 'Entertainment', ''),
(11, 0, 'Games', ''),
(12, 0, 'Holiday/Occasions', ''),
(13, 0, 'Hunks', ''),
(14, 0, 'Logos', ''),
(15, 0, 'Love', ''),
(16, 0, 'Music', ''),
(17, 0, 'Nature/Landscape', ''),
(18, 0, 'News & Politics', ''),
(19, 0, 'Other', ''),
(20, 0, 'People', ''),
(21, 0, 'Pets & Animals', ''),
(22, 0, 'Signs & Sayings', ''),
(23, 0, 'Spiritual', ''),
(24, 0, 'Sport', ''),
(25, 0, 'Technology', '');



CREATE TABLE `zjthemethemes` (
  `id` int(11) NOT NULL auto_increment COMMENT '主键',
  `name` char(200) NOT NULL COMMENT '主题名称',
  `author` char(100) NOT NULL COMMENT '作者',
  `groupid` int(8) NOT NULL COMMENT '分类(ZJThemesGroup)',
  `descript` text NOT NULL COMMENT '简介',
  `vernum` varchar(50) NOT NULL COMMENT '版本号',
  `level` int(8) NOT NULL COMMENT '用户评级',
  `views` int(8) NOT NULL COMMENT '查看数量',
  `donwload` int(8) NOT NULL COMMENT '下载数量',
  `image` char(50) NOT NULL COMMENT '预览图',
  `file` varchar(100) NOT NULL COMMENT '软件位置',
  `time` datetime NOT NULL COMMENT '上传的时间',
  `downloadtime` datetime NOT NULL COMMENT '最近下载的时间',
  `moneygold` int(8) NOT NULL COMMENT '金币',
  `moneysilver` int(8) NOT NULL COMMENT '银币',
  `tops` tinyint(2) NOT NULL COMMENT '顶部推荐',
  `tname` varchar(512) NOT NULL COMMENT '支持型号',
  `comment` varchar(200) NOT NULL COMMENT '注释',
  PRIMARY KEY  (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='主题列表' AUTO_INCREMENT=1 ;



CREATE TABLE `zjusercrossphones` (
  `userid` int(8) NOT NULL COMMENT '用户的唯一标志符',
  `phoneid` int(8) NOT NULL COMMENT '手机型号',
  `usedtime` int(8) NOT NULL COMMENT '用户使用此手机下载的次数',
  `firsttime` datetime NOT NULL COMMENT '首次下载的时间',
  `lasttime` datetime NOT NULL COMMENT '最近下载的时间',
  PRIMARY KEY  (`userid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='用户下载或使用过的手机';



CREATE TABLE `zjusersgroup` (
  `groupid` int(11) NOT NULL auto_increment COMMENT '组的唯一标志',
  `groupname` varchar(200) NOT NULL COMMENT '组的名称',
  `authorize` int(8) NOT NULL COMMENT '组用户被授予的权限',
  PRIMARY KEY  (`groupid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='用户组类型' AUTO_INCREMENT=1 ;




CREATE TABLE `zjusersmembership` (
  `userid` int(11) NOT NULL auto_increment COMMENT '用户的唯一标志符',
  `groupid` int(2) NOT NULL default '0' COMMENT '用户所属的组',
  `email` varchar(40) NOT NULL COMMENT '电子邮箱',
  `brandid` int(8) NOT NULL COMMENT '手机品牌',
  `moduleid` int(8) NOT NULL COMMENT '手机型号',
  `phone` varchar(100) NOT NULL COMMENT '新增手机型号',
  `created` datetime NOT NULL COMMENT '创造时间',
  `lastlogin` datetime NOT NULL COMMENT '最后登陆时间',
  `IsApproved` tinyint(1) NOT NULL default '1' COMMENT '用户是否可以登录',
  `IsLockedOut` tinyint(1) NOT NULL default '0' COMMENT '用户是否被锁定',
  `username` char(50) NOT NULL COMMENT '帐号',
  `password` char(50) NOT NULL COMMENT '密码',
  `PasswordQuestion` varchar(100) NOT NULL COMMENT '密码问题',
  `PasswordAnswer` varchar(100) NOT NULL COMMENT '密码答案',
  `IsOnLine` tinyint(1) NOT NULL default '1' COMMENT '是否在线',
  `moneygold` int(8) NOT NULL COMMENT '金币',
  `moneysilver` int(8) NOT NULL COMMENT '银币',
  PRIMARY KEY  (`userid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='用户表' AUTO_INCREMENT=1 ;



CREATE TABLE `zjusersprofile` (
  `userid` int(11) NOT NULL COMMENT '用户的唯一标志符',
  `name` char(100) NOT NULL COMMENT '用户名称',
  `sex` tinyint(1) NOT NULL default '0' COMMENT '性别,0不公开1男2女',
  `birthday` varchar(100) NOT NULL COMMENT '用户生日',
  `comment` text NOT NULL COMMENT '用户简介',
  `mobile` varchar(100) NOT NULL COMMENT '手机号',
  KEY `userid` (`userid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='用户详细表';




CREATE TABLE `zjwapadmin` (
  `id` int(11) NOT NULL auto_increment COMMENT '主键',
  `username` char(100) NOT NULL COMMENT '帐号',
  `password` char(100) NOT NULL COMMENT '密码',
  PRIMARY KEY  (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='后台管理' AUTO_INCREMENT=1 ;

-- 
-- '后台管理帐号zjadmin 密码123456`
-- 

INSERT INTO `zjwapadmin` (`id`, `username`, `password`) VALUES 
(1, 'zjadmin', '7c4a8d09ca3762af61e59520943dc26494f8941b');
