This commit is contained in:
aozhiwei 2020-10-20 10:37:04 +08:00
parent 9652916bfc
commit 4e4170e27d

View File

@ -30,7 +30,7 @@ class OrderCtrl {
return $conn; return $conn;
} }
public function getOrderByCp($orderid) public function getOrderByCpOrderId($orderid)
{ {
$conn = $this->getMysql(); $conn = $this->getMysql();
$row = $conn->execQueryOne('SELECT * FROM orderinfo ' . $row = $conn->execQueryOne('SELECT * FROM orderinfo ' .
@ -42,7 +42,7 @@ class OrderCtrl {
return $row; return $row;
} }
public function getOrderBySp($channel, $sp_orderid) public function getOrderBySpOrderId($channel, $sp_orderid)
{ {
$conn = $this->getMysql(); $conn = $this->getMysql();
$row = $conn->execQueryOne('SELECT * FROM orderinfo ' . $row = $conn->execQueryOne('SELECT * FROM orderinfo ' .
@ -71,32 +71,35 @@ class OrderCtrl {
private function internalAddOrder($order_info) private function internalAddOrder($order_info)
{ {
$conf = $this->getProduceConf($order_info['itemid']); $gameid = phpcommon\extractGameId($order_info['account_id']);
if (!$conf) { $openid = phpcommon\extractOpenId($order_info['account_id']);
die();
}
$gameid = !empty($order_info['gameid']) ? $order_info['gameid'] : 1009;
$conn = $this->getMysql(); $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, ' . ' gameid, openid, itemid, try_count, price, ipv4, status, ' .
' confirmtime, createtime, sp_orderid, sp_amount, ' . ' confirmtime, createtime, sp_orderid, sp_amount, ' .
' sp_confirm_time, sp_pay_result, ' . ' sp_confirm_time, sp_pay_result ' .
' charge_yb, gift_yb, att_data, attr_type, attr_value) ' . ' ) ' .
'VALUES (:orderid, :roleid, :server_id, :channel, ' . 'VALUES (:orderid, :account_id, :roleid, :server_id, :channel, ' .
' :poly_sdk_channel, :unified_channel, ' .
' :gameid, :openid, :itemid, :try_count, :price, :ipv4, :status, ' . ' :gameid, :openid, :itemid, :try_count, :price, :ipv4, :status, ' .
' :confirmtime, :createtime, :sp_orderid, :sp_amount, ' . ' :confirmtime, :createtime, :sp_orderid, :sp_amount, ' .
' :sp_confirm_time, :sp_pay_result, ' . ' :sp_confirm_time, :sp_pay_result ' .
' :charge_yb, :gift_yb, :att_data, :attr_type, :attr_value);', ' );',
array( array(
':orderid' => $order_info['orderid'], ':orderid' => $order_info['orderid'],
':account_id' => $order_info['account_id'],
':roleid' => $order_info['roleid'], ':roleid' => $order_info['roleid'],
':server_id' => $order_info['server_id'], ':server_id' => $order_info['server_id'],
':channel' => $order_info['channel'], ':channel' => $order_info['channel'],
':poly_sdk_channel' => $order_info['poly_sdk_channel'],
':unified_channel' => $order_info['unified_channel'],
':gameid' => $gameid, ':gameid' => $gameid,
':openid' => $order_info['openid'], ':openid' => $openid,
':itemid' => $order_info['itemid'], ':itemid' => $order_info['itemid'],
':try_count' => 0, ':try_count' => 0,
':price' => $conf['money'], ':price' => $order_info['price'],
':ipv4' => $order_info['ipv4'], ':ipv4' => $order_info['ipv4'],
':status' => 0, ':status' => 0,
':confirmtime' => 0, ':confirmtime' => 0,
@ -106,12 +109,6 @@ class OrderCtrl {
':sp_amount' => $order_info['sp_amount'], ':sp_amount' => $order_info['sp_amount'],
':sp_confirm_time' => $order_info['sp_confirm_time'], ':sp_confirm_time' => $order_info['sp_confirm_time'],
':sp_pay_result' => $order_info['sp_pay_result'], ':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; return $ret;