diff --git a/webapp/classes/OrderCtrl.php b/webapp/classes/OrderCtrl.php index 2eeb998..b47067a 100644 --- a/webapp/classes/OrderCtrl.php +++ b/webapp/classes/OrderCtrl.php @@ -30,7 +30,7 @@ class OrderCtrl { return $conn; } - public function getOrderByCp($orderid) + public function getOrderByCpOrderId($orderid) { $conn = $this->getMysql(); $row = $conn->execQueryOne('SELECT * FROM orderinfo ' . @@ -42,7 +42,7 @@ class OrderCtrl { return $row; } - public function getOrderBySp($channel, $sp_orderid) + public function getOrderBySpOrderId($channel, $sp_orderid) { $conn = $this->getMysql(); $row = $conn->execQueryOne('SELECT * FROM orderinfo ' . @@ -71,32 +71,35 @@ class OrderCtrl { private function internalAddOrder($order_info) { - $conf = $this->getProduceConf($order_info['itemid']); - if (!$conf) { - die(); - } - $gameid = !empty($order_info['gameid']) ? $order_info['gameid'] : 1009; + $gameid = phpcommon\extractGameId($order_info['account_id']); + $openid = phpcommon\extractOpenId($order_info['account_id']); $conn = $this->getMysql(); - $ret = $conn->execScript('INSERT INTO orderinfo(orderid, roleid, server_id, channel, ' . + $ret = $conn->execScript('INSERT INTO orderinfo(' . + ' orderid, account_id, roleid, server_id, channel, ' . + ' poly_sdk_channel, unified_channel, ' . ' gameid, openid, itemid, try_count, price, ipv4, status, ' . ' confirmtime, createtime, sp_orderid, sp_amount, ' . - ' sp_confirm_time, sp_pay_result, ' . - ' charge_yb, gift_yb, att_data, attr_type, attr_value) ' . - 'VALUES (:orderid, :roleid, :server_id, :channel, ' . + ' sp_confirm_time, sp_pay_result ' . + ' ) ' . + 'VALUES (:orderid, :account_id, :roleid, :server_id, :channel, ' . + ' :poly_sdk_channel, :unified_channel, ' . ' :gameid, :openid, :itemid, :try_count, :price, :ipv4, :status, ' . ' :confirmtime, :createtime, :sp_orderid, :sp_amount, ' . - ' :sp_confirm_time, :sp_pay_result, ' . - ' :charge_yb, :gift_yb, :att_data, :attr_type, :attr_value);', + ' :sp_confirm_time, :sp_pay_result ' . + ' );', array( ':orderid' => $order_info['orderid'], + ':account_id' => $order_info['account_id'], ':roleid' => $order_info['roleid'], ':server_id' => $order_info['server_id'], ':channel' => $order_info['channel'], + ':poly_sdk_channel' => $order_info['poly_sdk_channel'], + ':unified_channel' => $order_info['unified_channel'], ':gameid' => $gameid, - ':openid' => $order_info['openid'], + ':openid' => $openid, ':itemid' => $order_info['itemid'], ':try_count' => 0, - ':price' => $conf['money'], + ':price' => $order_info['price'], ':ipv4' => $order_info['ipv4'], ':status' => 0, ':confirmtime' => 0, @@ -106,12 +109,6 @@ class OrderCtrl { ':sp_amount' => $order_info['sp_amount'], ':sp_confirm_time' => $order_info['sp_confirm_time'], ':sp_pay_result' => $order_info['sp_pay_result'], - - ':charge_yb' => $conf['money'] * 10, - ':gift_yb' => 0, - ':att_data' => '', - ':attr_type' => $conf['type'], - ':attr_value' => $conf['index'], ) ); return $ret;