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, + ), + ) + )); + } + } ?>