From 32c068beb8876295af8493ba0b959417f63ed294 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Wed, 2 Aug 2023 17:41:56 +0800 Subject: [PATCH] 1 --- webapp/services/callback/OutAppPurchase.php | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/webapp/services/callback/OutAppPurchase.php b/webapp/services/callback/OutAppPurchase.php index cf737598..bfef3b52 100644 --- a/webapp/services/callback/OutAppPurchase.php +++ b/webapp/services/callback/OutAppPurchase.php @@ -75,12 +75,10 @@ class OutAppPurchase { myself()->_rspErr(0, 'goods_id is failed'); return; } - $goodsNum = $orderDb['goods_num']; - $bundleSize = $goodsMeta['bonus_num'] ? $goodsMeta['bonus_num'] : 0; - $itemNum = $goodsNum * $bundleSize; + $itemNum = $goodsMeta['bonus_num']; $itemId = $goodsMeta['bonus']; - $meta = mt\Item::get($itemId); - if ($meta && $itemNum > 0) { + $itemMeta = mt\Item::get($itemId); + if ($itemMeta && $itemNum > 0) { if ($itemId == V_ITEM_DIAMOND) { $event = [ 'name' => LogService::RECHARGE_CEBG_BONUS, @@ -91,15 +89,11 @@ class OutAppPurchase { 'account_id' => $orderDb['account_id'] ), $event); + $addItemService = new ShopAddItemService(); + $addItemService->addItemByAccountId($orderDb['account_id'], $itemId, $itemNum); + } else { + } - - error_log("buyGoodsDirect---" . $address . "---" . $itemId . "---" . $itemNum); - - $this->_addGoods($address, array( - 'goods_id' => $itemId, - 'goods_num' => $itemNum, - 'id' => $id, - )); } $this->_rspOk();