67 lines
1.7 KiB
PHP
67 lines
1.7 KiB
PHP
<?php
|
|
|
|
namespace services;
|
|
|
|
require_once('phpcommon/bchelper.php');
|
|
|
|
require_once('models/BcOrder.php');
|
|
|
|
require_once ('services/callback/BuyPassCbService.php');
|
|
require_once ('services/callback/BuyShopGoodsCbService.php');
|
|
require_once ('services/callback/common/SignatureService.php');
|
|
|
|
use phpcommon\SqlHelper;
|
|
|
|
use models\BcOrder;
|
|
|
|
/*
|
|
const params = {
|
|
'c': 'Callback',
|
|
'a': 'dispatch',
|
|
'action': 'gameItemMallBuyOk',
|
|
'trans_id': transId,
|
|
'order_id': orderId,
|
|
};
|
|
*/
|
|
class GameItemMallBuyOk {
|
|
|
|
public function process()
|
|
{
|
|
SignatureService::web3ServiceCheck();
|
|
$transId = getReqVal('trans_id', '');
|
|
$orderId = getReqVal('order_id', '');
|
|
|
|
error_log("GameItemMallBuyOk-------------------");
|
|
$orderDb = BcOrder::find($orderId);
|
|
if (!$orderDb) {
|
|
myself()->_rspErr(2, 'Order does not exist');
|
|
return;
|
|
}
|
|
if ($orderDb['status'] == 1){
|
|
myself()->_rspErr(1, 'Order shipped');
|
|
return;
|
|
}
|
|
BcOrder::update($orderDb['order_id'],
|
|
array(
|
|
'status' => 1
|
|
));
|
|
if ($orderDb['order_type'] == BcOrder::SPEC_ORDER_TYPE) {
|
|
}
|
|
/*
|
|
// 小胡 回调的处理
|
|
if ($this->_isVirtualItem($orderDb['item_id'])){
|
|
$passCbService = new BuyPassCbService();
|
|
$passCbService->process($orderDb);
|
|
} else {
|
|
// 老宋 处理...
|
|
$shopGoodsCbService = new BuyShopGoodsCbService();
|
|
$shopGoodsCbService->process($orderDb);
|
|
|
|
}
|
|
*/
|
|
|
|
myself()->_rspOk();
|
|
}
|
|
|
|
}
|