This commit is contained in:
yangduo 2025-01-06 14:47:37 +08:00
parent 499586b8a9
commit 0004645b90
2 changed files with 37 additions and 3 deletions

View File

@ -350,4 +350,39 @@ CREATE TABLE `recharge` (
PRIMARY KEY (`idx`), PRIMARY KEY (`idx`),
UNIQUE KEY `accountid` (`accountid`) UNIQUE KEY `accountid` (`accountid`)
) ENGINE=InnoDB AUTO_INCREMENT=10000 DEFAULT CHARSET=utf8 COLLATE=utf8_bin; ) 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 -- Dump completed on 2015-08-19 18:51:22

View File

@ -282,15 +282,14 @@ class RechargeController
private function insertNewOrder($conn, $nowtime, $item_list) private function insertNewOrder($conn, $nowtime, $item_list)
{ {
$ret = $conn->execScript('INSERT INTO orderinfo(accountid, orderid, goodsid, price, '. $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, ' . 'VALUES(:accountid, :orderid, :goodsid, :price, ' .
' :confirmtime, :create_time, :modify_time, :item_list);', ' :create_time, :modify_time, :item_list);',
array( array(
':accountid' => $_REQUEST['account_id'], ':accountid' => $_REQUEST['account_id'],
':orderid' => $_REQUEST['orderid'], ':orderid' => $_REQUEST['orderid'],
':price' => $_REQUEST['amount'], ':price' => $_REQUEST['amount'],
':goodsid' => $_REQUEST['goodsid'], ':goodsid' => $_REQUEST['goodsid'],
':confirmtime' => $nowtime,
':create_time' => $nowtime, ':create_time' => $nowtime,
':modify_time' => $nowtime, ':modify_time' => $nowtime,
':item_list' => json_encode($item_list) ':item_list' => json_encode($item_list)