活動表
aid: 活動編號
title: 活動名稱
desc: 活動描述
imgurl: 活動圖片
starttime:活動開始時間
endtime:活動結束時間
totalpeople:總報名人數
totaltickets:總投票人數
totalaccess:總訪問量
votelimit: 每個選手每個活動每天投票次數
選手表
cid: 選手編號(流水號)
aid: 活動編號
cname:選手姓名
cdeclaration:宣言
mobile: 手機號碼
sex:性別
address: 收獲地址
hots: 熱度
gifts: 禮物數
tickets:票數
imgurl: 封面圖
選手圖片表
id: 流水號
cid: 選手編號
imgurl: 圖片
投票記錄表(微信應用搭載在一個微信服務號)
id: 流水號
openid: 登錄人的ip
cid: 選手編號
aid: 活動編號
votetime: 投票時間
獎品表
pid: 流水號
aid: 活動編號
level: 獎品類別, 一等獎,二等獎,三等獎
pname: 獎品名稱
pcount: 獎品數量
pimg: 獎品圖片
禮物表
lwid 禮物編號
lwname 禮物名稱
lwimg 禮物圖片
dianshu 點數(1點=1票)
price 錢數
禮物記錄表
id: 流水號
openid: 登錄人的ip
cid: 選手編號
aid: 活動編號
votetime: 買禮物時間
lwid 禮物id
lwcount 禮物個數
price: 禮物的單價
獲獎表:
cid:
aid:
gid:
建表腳本
~~~
/*
MySQL Data Transfer
Source Host: 10.25.42.131
Source Database: vote
Target Host: 10.25.42.131
Target Database: vote
Date: 2018-4-2 16:25:19
*/
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for activity
-- ----------------------------
CREATE TABLE `activity` (
`aid` int(11) NOT NULL AUTO_INCREMENT,
`title` varchar(255) DEFAULT NULL,
`desc` varchar(255) DEFAULT NULL,
`imgurl` varchar(255) DEFAULT NULL,
`starttime` datetime DEFAULT NULL,
`endtime` datetime DEFAULT NULL,
`totalpeople` int(11) DEFAULT NULL,
`totaltickets` int(11) DEFAULT NULL,
`totalaccess` int(11) DEFAULT NULL,
`votelimit` int(11) DEFAULT NULL,
PRIMARY KEY (`aid`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for candidate
-- ----------------------------
CREATE TABLE `candidate` (
`cid` int(11) NOT NULL AUTO_INCREMENT,
`aid` int(11) DEFAULT NULL,
`cname` varchar(255) DEFAULT NULL,
`cdeclaration` varchar(255) DEFAULT NULL,
`mobile` varchar(255) DEFAULT NULL,
`sex` char(2) DEFAULT NULL,
`address` varchar(255) DEFAULT NULL,
`hots` int(11) DEFAULT NULL,
`gifts` int(11) DEFAULT NULL,
`tickets` int(11) DEFAULT NULL,
`imgurl` varchar(255) DEFAULT NULL,
PRIMARY KEY (`cid`)
) ENGINE=InnoDB AUTO_INCREMENT=45 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for images
-- ----------------------------
CREATE TABLE `images` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`cid` int(11) DEFAULT NULL,
`imgurl` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for lw
-- ----------------------------
CREATE TABLE `lw` (
`lwid` int(11) NOT NULL AUTO_INCREMENT,
`lwname` varchar(255) DEFAULT NULL,
`lwimg` varchar(255) DEFAULT NULL,
`dianshu` int(11) DEFAULT NULL,
`price` double DEFAULT NULL,
PRIMARY KEY (`lwid`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for lwrecord
-- ----------------------------
CREATE TABLE `lwrecord` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`openid` varchar(255) DEFAULT NULL,
`cid` int(11) DEFAULT NULL,
`lwid` int(11) DEFAULT NULL,
`lwcount` int(11) DEFAULT NULL,
`aid` int(11) DEFAULT NULL,
`stime` datetime DEFAULT NULL,
`price` double DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for prize
-- ----------------------------
CREATE TABLE `prize` (
`pid` int(11) NOT NULL AUTO_INCREMENT,
`aid` int(11) DEFAULT NULL,
`level` varchar(255) DEFAULT NULL,
`pname` varchar(255) DEFAULT NULL,
`pcount` int(11) DEFAULT NULL,
`pimg` varchar(255) DEFAULT NULL,
PRIMARY KEY (`pid`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for voterecord
-- ----------------------------
CREATE TABLE `voterecord` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`openid` varchar(255) DEFAULT NULL,
`cid` int(11) DEFAULT NULL,
`aid` int(11) DEFAULT NULL,
`votetime` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=8481 DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records
-- ----------------------------
INSERT INTO `activity` VALUES ('1', '最美女神', '最美女神最美女神最美女神', 'a.jpg', '2018-03-25 15:24:47', '2018-04-04 15:24:54', '2', '0', '0', '2');
INSERT INTO `candidate` VALUES ('1', '1', '小美', '我最美', '15940470000', '女', '渾南區', '0', '0', '0', '1.png');
INSERT INTO `candidate` VALUES ('2', '1', '小麗', '我要贏', '15940471111', '女', '大東區', '0', '0', '0', '2.png');
INSERT INTO `images` VALUES ('1', '1', '1.png');
INSERT INTO `images` VALUES ('2', '1', '2.png');
INSERT INTO `images` VALUES ('3', '1', '3.png');
INSERT INTO `images` VALUES ('4', '2', '1.png');
INSERT INTO `images` VALUES ('5', '2', '2.png');
INSERT INTO `lw` VALUES ('1', '氣球', '1.png', '10', '1.99');
INSERT INTO `lw` VALUES ('2', '小花', '2.png', '5', '0.99');
INSERT INTO `lw` VALUES ('3', '魚丸', '3.png', '20', '2.99');
INSERT INTO `lw` VALUES ('4', '飛機', '1.png', '50', '6.99');
INSERT INTO `lw` VALUES ('5', '磚石', 'a.jpg', '100', '10.99');
INSERT INTO `prize` VALUES ('1', '1', '1', 'iphonex', '1', '1.png');
INSERT INTO `prize` VALUES ('2', '1', '2', 'iwatch', '2', '2.png');
INSERT INTO `prize` VALUES ('3', '1', '3', 'bike', '3', '3.png');
~~~