diff --git a/sql/gamedb.sql b/sql/gamedb.sql index 02a2862..3fc11b5 100644 --- a/sql/gamedb.sql +++ b/sql/gamedb.sql @@ -350,4 +350,39 @@ CREATE TABLE `recharge` ( PRIMARY KEY (`idx`), UNIQUE KEY `accountid` (`accountid`) ) ENGINE=InnoDB AUTO_INCREMENT=10000 DEFAULT CHARSET=utf8 COLLATE=utf8_bin; + +DROP TABLE IF EXISTS `orderinfo`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `orderinfo` ( + `idx` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '自增id', + `accountid` varchar(60) NOT NULL DEFAULT '' COMMENT '账号id', + `orderid` varchar(255) NOT NULL DEFAULT '' COMMENT '订单号', + `price` int(11) NOT NULL DEFAULT '0' COMMENT '价格,分', + `goodsid` int(11) NOT NULL DEFAULT '0' COMMENT ' 商品id', + `create_time` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间', + `modify_time` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间', + `item_list` text DEFAULT '' COMMENT '内容', + PRIMARY KEY (`idx`), + KEY `idx_accountid` (`accountid`), + KEY `idx_orderid` (`orderid`), + KEY `idx_goodsid` (`goodsid`), + KEY `idx_time` (`create_time`) +) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COLLATE=utf8_bin; + +DROP TABLE IF EXISTS `buy_his`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `buy_his` ( + `idx` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '自增id', + `accountid` varchar(60) NOT NULL DEFAULT '' COMMENT '账号id', + `goodsid` int(11) NOT NULL DEFAULT '0' COMMENT ' 商品id', + `sum_times` int(11) NOT NULL DEFAULT '0' COMMENT '总次数', + `today_times` int(11) NOT NULL DEFAULT '0' COMMENT '当天次数', + `last_buy_time` int(11) NOT NULL DEFAULT '0' COMMENT '最近购买时间', + `create_time` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间', + `modify_time` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间', + PRIMARY KEY (`idx`), + UNIQUE KEY `accountid_goodsid` (`accountid`, `goodsid`) +) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COLLATE=utf8_bin; -- Dump completed on 2015-08-19 18:51:22 diff --git a/webapp/controller/RechargeController.class.php b/webapp/controller/RechargeController.class.php index 58bffe0..ede0a2e 100644 --- a/webapp/controller/RechargeController.class.php +++ b/webapp/controller/RechargeController.class.php @@ -282,15 +282,14 @@ class RechargeController private function insertNewOrder($conn, $nowtime, $item_list) { $ret = $conn->execScript('INSERT INTO orderinfo(accountid, orderid, goodsid, price, '. - ' confirmtime, create_time, modify_time, item_list)' . + ' create_time, modify_time, item_list)' . 'VALUES(:accountid, :orderid, :goodsid, :price, ' . - ' :confirmtime, :create_time, :modify_time, :item_list);', + ' :create_time, :modify_time, :item_list);', array( ':accountid' => $_REQUEST['account_id'], ':orderid' => $_REQUEST['orderid'], ':price' => $_REQUEST['amount'], ':goodsid' => $_REQUEST['goodsid'], - ':confirmtime' => $nowtime, ':create_time' => $nowtime, ':modify_time' => $nowtime, ':item_list' => json_encode($item_list)