61 lines
1.5 KiB
PHP
61 lines
1.5 KiB
PHP
<?php
|
|
|
|
namespace services;
|
|
|
|
require_once('phpcommon/bchelper.php');
|
|
require_once ('services/callback/BuyPassCbService.php');
|
|
require_once ('services/callback/BuyShopGoodsCbService.php');
|
|
|
|
use phpcommon\SqlHelper;
|
|
|
|
class gameItemMallBuyOk {
|
|
|
|
public function process()
|
|
{
|
|
$address = getReqVal('address', '');
|
|
$orderId = getReqVal('orderId', '');
|
|
|
|
$orderDb = SqlHelper::ormSelectOne(
|
|
myself()->_getMysql($address),
|
|
't_bc_order',
|
|
array(
|
|
'order_id' => $orderId
|
|
)
|
|
);
|
|
|
|
// 小胡 回调的处理
|
|
if ($this->_isVirtualItem($orderDb['item_id'])){
|
|
$passCbService = new BuyPassCbService();
|
|
$passCbService->process($orderDb);
|
|
|
|
} else {
|
|
// 老宋 处理...
|
|
$shopGoodsCbService = new BuyShopGoodsCbService();
|
|
$shopGoodsCbService->process($orderDb);
|
|
|
|
}
|
|
|
|
// 修改订单状态
|
|
$this->_updateOrderState($address,$orderId);
|
|
}
|
|
|
|
private function _isVirtualItem($itemId){
|
|
return in_array($itemId, array(V_ITEM_EXP, V_ITEM_PASS));
|
|
}
|
|
|
|
private function _updateOrderState($address,$transId){
|
|
SqlHelper::update
|
|
(myself()->_getMysql($address),
|
|
't_bc_order',
|
|
array(
|
|
'order_id' => $transId
|
|
),
|
|
array(
|
|
'status' => 1,
|
|
'modifytime' => myself()->_getNowTime(),
|
|
)
|
|
);
|
|
}
|
|
|
|
}
|