...
This commit is contained in:
parent
cd89285e1e
commit
bf9c4549c1
@ -335,35 +335,29 @@ class ShopController extends BaseAuthedController
|
||||
|
||||
SqlHelper::update($conn, 't_shop_buy_order', array('idx' => $order_id), array('status' => $buyStatus));
|
||||
|
||||
$row = mt\ShopGoods::get($id);
|
||||
if ($row) {
|
||||
$desired_token_type = $row['token_type'];
|
||||
$check_token_type = splitStr1($desired_token_type);
|
||||
// $token_pos = array_search($token_type, $check_token_type, true);
|
||||
// if (!in_array($token_type, $check_token_type)) {
|
||||
// $this->_rspErr(1, "token_type parameter error, desired_token_type: {$desired_token_type}");
|
||||
// return;
|
||||
// }
|
||||
$goods = mt\ShopGoods::get($id);
|
||||
// 这里命名混乱了, 购买个数,一捆个数命名冲突
|
||||
$goods_num = $order['goods_num'];
|
||||
$bundle_size = $goods['bonus_num'];
|
||||
$item_num = $goods_num * $bundle_size;
|
||||
$item_id = $goods['bonus'];
|
||||
$address = $order['address'];
|
||||
$account_id = $this->getAccountId($address);
|
||||
|
||||
if ($goods_num > $row['max_amount']) {
|
||||
$this->_rspErr(1, "goods_num parameter error, max_amount: {$row['max_amount']}");
|
||||
return;
|
||||
}
|
||||
|
||||
// 这里命名混乱了, 购买个数,一捆个数命名冲突
|
||||
$goods_count = $row['goods_num'];
|
||||
|
||||
$itemMeta = mt\Item::get($row['goods_id']);
|
||||
$propertyChgService = new services\PropertyChgService();
|
||||
for ($i = 0; $i < $goods_num; $i++) {
|
||||
// 既然这种货币是在链上的,那么这里不应该增加任何物品,
|
||||
// $this->internalAddItem($propertyChgService, $itemMeta, $goods_count, 0);
|
||||
}
|
||||
$awardService = new services\AwardService();
|
||||
// $awardService->addItem($row['goods_id'], $goods_num);
|
||||
ShopBuyRecord::add($id, $goods_num);
|
||||
if ($item_id == V_ITEM_DIAMOND) {
|
||||
$event = [
|
||||
'name' => LogService::RECHARGE_CEBG_BONUS,
|
||||
'val' => $item_num
|
||||
];
|
||||
LogService::productDiamond(['account_id' => $account_id], $event);
|
||||
}
|
||||
|
||||
$this->_addGoods($address, array(
|
||||
'goods_id' => $item_id,
|
||||
'goods_num' => $item_num,
|
||||
'id' => $id,
|
||||
));
|
||||
|
||||
$this->_rspOk();
|
||||
}
|
||||
|
||||
|
@ -30,6 +30,7 @@ class LogService extends BaseService
|
||||
|
||||
const CEBG_TO_DIAMOND = "cebg_to_diamond"; //CEBG兑换钻石
|
||||
const RECHARGE_DIAMOND = "recharge_diamond"; //充值钻石
|
||||
const RECHARGE_CEBG_BONUS = "recarge_cebg_bonus"; //充值CEBG奖励
|
||||
|
||||
|
||||
const PRONAME = 'game_2006_api';
|
||||
|
Loading…
x
Reference in New Issue
Block a user