From 05cfc7c51c9fde186e176169ef28c22de231ec3d Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Wed, 21 Aug 2019 18:56:03 +0800 Subject: [PATCH 1/6] 1 --- third_party/phpcommon | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/third_party/phpcommon b/third_party/phpcommon index 0389b4b..f401b4f 160000 --- a/third_party/phpcommon +++ b/third_party/phpcommon @@ -1 +1 @@ -Subproject commit 0389b4b5b996ac76334b4ea96c7fac1b2e9db050 +Subproject commit f401b4f89a47b3f4d2835a647d68ad11deac9275 From d5a109e2f15640ad71ed34f3e7d1a39ecf07697d Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Wed, 21 Aug 2019 19:42:32 +0800 Subject: [PATCH 2/6] 1 --- third_party/phpcommon | 2 +- webapp/controller/PayController.class.php | 14 +++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/third_party/phpcommon b/third_party/phpcommon index f401b4f..7ecf558 160000 --- a/third_party/phpcommon +++ b/third_party/phpcommon @@ -1 +1 @@ -Subproject commit f401b4f89a47b3f4d2835a647d68ad11deac9275 +Subproject commit 7ecf558df93a2656631782e76c6d35697da72808 diff --git a/webapp/controller/PayController.class.php b/webapp/controller/PayController.class.php index 8e9d622..e77c40c 100644 --- a/webapp/controller/PayController.class.php +++ b/webapp/controller/PayController.class.php @@ -412,10 +412,22 @@ class PayController{ $itemid = $_REQUEST['itemid']; $itemnum = $_REQUEST['itemnum']; + $params = array( + 'account_id' => $_REQUEST['account_id'], + 'itemid' => 1, + 'itemnum' => 1, + 'price' => 0.01 + ); + $timestamp = time(); + $params['sign'] = phpcommon\md5Sign($params, '06ba97e28ea905b0b7ed5477746b07f1', $timestamp); + $params['timestamp'] = $timestamp; + $iv = 'wx1dd2f605f4f8496b'; + $key = 'c868a478c81ff3c168b35d703f787d3c'; + $str_encoded = '2001_' . base64_encode(phpcommon\aesEncrypt(json_encode($params), $iv, $key)); echo json_encode(array( 'errcode' => 0, 'errmsg'=> '', - 'data' => 'hello' + 'data' => $str_encoded )); } } From 8e6f3ab49cc48a0a971c862eda7aea6f702ed20c Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Thu, 22 Aug 2019 10:35:35 +0800 Subject: [PATCH 3/6] 1 --- webapp/controller/PayController.class.php | 2 +- webapp/controller/ServerSwitchController.class.php | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 webapp/controller/ServerSwitchController.class.php diff --git a/webapp/controller/PayController.class.php b/webapp/controller/PayController.class.php index e77c40c..f221821 100644 --- a/webapp/controller/PayController.class.php +++ b/webapp/controller/PayController.class.php @@ -421,7 +421,7 @@ class PayController{ $timestamp = time(); $params['sign'] = phpcommon\md5Sign($params, '06ba97e28ea905b0b7ed5477746b07f1', $timestamp); $params['timestamp'] = $timestamp; - $iv = 'wx1dd2f605f4f8496b'; + $iv = '1dd2f605f4f8496b'; $key = 'c868a478c81ff3c168b35d703f787d3c'; $str_encoded = '2001_' . base64_encode(phpcommon\aesEncrypt(json_encode($params), $iv, $key)); echo json_encode(array( diff --git a/webapp/controller/ServerSwitchController.class.php b/webapp/controller/ServerSwitchController.class.php new file mode 100644 index 0000000..c0c3dd6 --- /dev/null +++ b/webapp/controller/ServerSwitchController.class.php @@ -0,0 +1,14 @@ + 0, + 'errmsg' => '', + 'payable' => 1 + )); + } + +} From 22e93fc7ec3a87a121bf4bc9f0c976b8b7dcf6b4 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Thu, 22 Aug 2019 15:23:36 +0800 Subject: [PATCH 4/6] 1 --- webapp/controller/SignController.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/webapp/controller/SignController.class.php b/webapp/controller/SignController.class.php index 6676118..a4f3ba4 100644 --- a/webapp/controller/SignController.class.php +++ b/webapp/controller/SignController.class.php @@ -228,6 +228,7 @@ class SignController{ 'errcode' => 0, 'errmsg' => '', )); + } public function signDoubleReward() @@ -322,7 +323,7 @@ class SignController{ } } //刷新战斗结算奖励次数,商店刷新次数,客服 - $battle_ret = $conn->execScript('UPDATE user SET battle_re_times=0, diamond_shop_flush_times=0, shop_flush_times=0, kefu_status=0, modify_time=:modify_time ' . + $battle_ret = $conn->execScript('UPDATE user SET battle_re_times=0, shop_flush_times=0, kefu_status=0, modify_time=:modify_time ' . ' WHERE accountid=:accountid;', array( ':accountid' => $account_id, From fe0af019085337a8eef4aac3357c87bc641191ec Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Thu, 22 Aug 2019 16:20:50 +0800 Subject: [PATCH 5/6] 1 --- sql/gamedb.sql | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sql/gamedb.sql b/sql/gamedb.sql index 7824589..ee536e5 100644 --- a/sql/gamedb.sql +++ b/sql/gamedb.sql @@ -292,8 +292,9 @@ CREATE TABLE `buy_his` ( `itemid` int(11) NOT NULL DEFAULT '0' COMMENT 'itemid', `sum_times` int(11) NOT NULL DEFAULT '0' COMMENT '累计充值次数', `today_times` 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 '修改时间', + `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`), KEY `accountid` (`accountid`), UNIQUE KEY `accountid_itemid` (`accountid`, `itemid`) @@ -313,8 +314,9 @@ CREATE TABLE `orderinfo` ( `create_time` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间', `modify_time` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间', PRIMARY KEY (`idx`), + UNIQUE KEY `orderid` (`orderid`), KEY `accountid` (`accountid`), - UNIQUE KEY `orderid` (`orderid`) + KEY `accountid_itemid` (`accountid`, `itemid`) ) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COLLATE=utf8_bin; DROP TABLE IF EXISTS `vipinfo`; From f1849874c540fe001dc987383d33b5b6084a62cd Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Thu, 22 Aug 2019 19:17:24 +0800 Subject: [PATCH 6/6] 1 --- webapp/controller/PayController.class.php | 51 ++++++++++++++++++++++- 1 file changed, 49 insertions(+), 2 deletions(-) diff --git a/webapp/controller/PayController.class.php b/webapp/controller/PayController.class.php index f221821..769c1a0 100644 --- a/webapp/controller/PayController.class.php +++ b/webapp/controller/PayController.class.php @@ -408,13 +408,19 @@ class PayController{ phpcommon\sendError(ERR_USER_BASE + 1, 'session无效'); return; } - $itemid = $_REQUEST['itemid']; $itemnum = $_REQUEST['itemnum']; + $itemnum = 1; + + $item_meta_table = require('../res/item@item.php'); + $item_meta = getItemConfig($item_meta_table, $itemid); + if ($item_meta) { + + } $params = array( 'account_id' => $_REQUEST['account_id'], - 'itemid' => 1, + 'itemid' => $itemid, 'itemnum' => 1, 'price' => 0.01 ); @@ -430,5 +436,46 @@ class PayController{ 'data' => $str_encoded )); } + + public function getOrderInfo() + { + if (!loginVerify($_REQUEST['account_id'], + $_REQUEST['session_id'])) { + phpcommon\sendError(ERR_USER_BASE + 1, 'session无效'); + return; + } + + $conn = $this->getMysql($_REQUEST['account_id']); + $row = $conn->execQueryOne('SELECT orderid, status FROM orderinfo WHERE orderid=:orderid;', + array( + ':orderid' => $_REQUEST['orderid'] + )); + if (!$row || $row['status'] == 0) { + echo json_encode(array( + 'errcode' => 0, + 'errmsg'=> '', + 'order_state' => 1, + )); + die(); + } + echo json_encode(array( + 'errcode' => 0, + 'errmsg'=> '', + 'order_state' => 0, + 'buy_itemid' => 0, + 'buy_itemnum' => 0, + 'item_list' => array( + array( + 'itemid' => 10001, + 'itemnum' => 1000, + ), + array( + 'itemid' => 10003, + 'itemnum' => 1000, + ), + ) + )); + } + } ?>