wallet tron transactions

This commit is contained in:
cano
2024-03-25 06:15:36 +08:00
parent 4b8f205e86
commit 489090382f
83 changed files with 5424 additions and 1343 deletions

View File

@ -0,0 +1,31 @@
<?php
namespace App\Service;
use App\Bean\Queue\Wallet\QueueWalletPlatformTransactionBean;
use App\Exceptions\QueueException;
use App\Models\Wallet\Platform\WalletPlatformBalanceTransactionModel;
use App\Models\Wallet\Platform\WalletPlatformBindModel;
class PlatformRechargeService
{
function walletPlatformTransactionConsumer(QueueWalletPlatformTransactionBean $bean): void
{
//根据钱包id查找平台和用户
$oWalletPlatformBindModel = new WalletPlatformBindModel();
$resBindModel = $oWalletPlatformBindModel->findItem($bean->getWalletId());
if (!$resBindModel) throw new QueueException('钱包不存在');
$oWalletPlatformBalanceTransactionModel = new WalletPlatformBalanceTransactionModel();
$res = $oWalletPlatformBalanceTransactionModel->typeRecharge(
$resBindModel->platform_id,
$resBindModel->uid,
$resBindModel->currency_code,
$bean->getAmount(),
$bean->getWalletId(),
$bean->getBlockTransactionId(),
$bean->getWalletTransactionId()
);
if (!$res) throw new QueueException('typeRecharge fail');
}
}