diff --git a/webapp/models/InAppRecord.php b/webapp/models/InAppRecord.php index eb6626d9..89e9c4d8 100644 --- a/webapp/models/InAppRecord.php +++ b/webapp/models/InAppRecord.php @@ -55,7 +55,7 @@ class InAppRecord extends BaseModel { myself()->_getMysql($accountId), 't_inapp_record', array( - 'account_id' => myself()->_getAccountId(), + 'account_id' => $accountId, 'daytime' => myself()->_getNowDaySeconds() ), array( @@ -68,7 +68,7 @@ class InAppRecord extends BaseModel { 'modifytime' => myself()->_getNowTime(), ), array( - 'account_id' => myself()->_getAccountId(), + 'account_id' => $accountId, 'amount_ok' => $amount, 'buy_ok_times' => 1, 'daytime' => myself()->_getNowDaySeconds(), diff --git a/webapp/services/callback/InAppPurchase.php b/webapp/services/callback/InAppPurchase.php index 7f863a4b..52d99da7 100644 --- a/webapp/services/callback/InAppPurchase.php +++ b/webapp/services/callback/InAppPurchase.php @@ -68,7 +68,6 @@ class InAppPurchase { private function verifySign($data) { - return true; $channel = $data['channel']; $records = $data['records']; $sign = $data['sign']; @@ -126,17 +125,18 @@ class InAppPurchase { $itemId = $goodsMeta['item_id']; $itemNum = $goodsMeta['item_num']; if ($itemId == V_ITEM_DIAMOND) { - InAppRecord::addAmount($orderDb['price']); + InAppRecord::addAmountOk($orderDb['account_id'], $orderDb['price']); $event = [ 'name' => LogService::RECHARGE_DIAMOND, 'val' => $itemNum ]; + error_log('InAppPurchase senditem ' . $itemId . ' ' . $itemNum); LogService::productDiamondCallback(['account_id' => $orderDb['account_id']], $event); $addItemService = new ShopAddItemService(); $addItemService->addItemByAccountId($orderDb['account_id'], $itemId, $itemNum); myself()->_addLogEx($orderDb['account_id'], 'InAppPurchase', 'ok', array( - $ordreDb['order_id'], + $orderDb['order_id'], json_encode($orderDb) )); } else {