diff --git a/sql/paydb.sql b/sql/paydb.sql index 3b0bdb4..3654aa2 100644 --- a/sql/paydb.sql +++ b/sql/paydb.sql @@ -82,13 +82,13 @@ DROP TABLE IF EXISTS `receipt`; CREATE TABLE `receipt` ( `idx` bigint NOT NULL AUTO_INCREMENT COMMENT '自增id', `receipt_id` varchar(255) NOT NULL DEFAULT '' COMMENT '票据id', + `orderid` varchar(255) DEFAULT '' COMMENT '订单id', `account_id` varchar(255) NOT NULL DEFAULT '' COMMENT 'account_id', `roleid` varchar(255) NOT NULL DEFAULT '' COMMENT '角色id', - `server_id` int(11) NOT NULL DEFAULT '0' COMMENT 'server_id', + `server_id ` int(11) NOT NULL DEFAULT '0' COMMENT 'server_id', `channel` int(11) NOT NULL DEFAULT '0' COMMENT 'channel', `gameid` int(11) NOT NULL DEFAULT '0' COMMENT 'gameid', `itemid` int(11) NOT NULL DEFAULT '0' COMMENT '商品id', - `price` int(11) NOT NULL DEFAULT '0' COMMENT 'price', `ipv4` varchar(50) NOT NULL DEFAULT '' COMMENT 'ipv4地址', `receipt_data` mediumblob COMMENT '票据信息', `createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间', diff --git a/webapp/classes/OrderCtrl.php b/webapp/classes/OrderCtrl.php index 5261b2f..912cc91 100644 --- a/webapp/classes/OrderCtrl.php +++ b/webapp/classes/OrderCtrl.php @@ -65,6 +65,42 @@ class OrderCtrl { return $row; } + public function getReceipt($receipt_id) + { + $conn = $this->getMysql($this->getStrDNA($receipt_id)); + $row = $conn->execQueryOne('SELECT receipt_id, account_id, roleid, orderid FROM receipt ' . + 'WHERE receipt_id=:receipt_id;', + array( + ':receipt_id' => $receipt_id + ) + ); + return $row; + } + + public function addReceipt($receipt_info) + { + $gameid = phpcommon\extractGameId($receipt_info['account_id']); + $conn = $this->getMysql($this->getStrDNA($receipt_info['receipt_id'])); + $conn->execScript('INSERT INTO receipt( ' . + ' receipt_id, orderid, account_id, roleid, server_id, channel, ' . + ' gameid, itemid, ipv4, receipt_data, createtime) ' . + 'VALUES (:receipt_id, :orderid, :account_id, :roleid, :server_id, :channel, ' . + ' :gameid, :itemid, :ipv4, :receipt_data, :createtime);', + array( + ':receipt_id' => $receipt_info['receipt_id'], + ':orderid' => $receipt_info['orderid'], + ':account_id' => $receipt_info['account_id'], + ':roleid' => $receipt_info['roleid'], + ':server_id' => $receipt_info['server_id'], + ':channel' => $receipt_info['channel'], + ':gameid' => $gameid, + ':itemid' => $receipt_info['itemid'], + ':ipv4' => phpcommon\getIPv4(), + ':receipt_data' => $receipt_info['receipt_data'], + ':createtime' => time(), + )); + } + public function addPreOrder($pre_order_info) { $pre_order_info['sp_orderid'] = ''; diff --git a/webapp/sdkwarpper/BaseSdk.php b/webapp/sdkwarpper/BaseSdk.php index 8a94404..19bf55c 100644 --- a/webapp/sdkwarpper/BaseSdk.php +++ b/webapp/sdkwarpper/BaseSdk.php @@ -33,10 +33,18 @@ class BaseSdk { } + public function getPendingOrderList() + { + } + public function payNotify() { } + public function deliver() + { + } + public function queryOrderInfo() { $order_info = $this->order_ctrl->getOrder($_REQUEST['cp_orderid']);