add service dir
This commit is contained in:
31
app/Service/Wallet/PlatformRechargeService.php
Normal file
31
app/Service/Wallet/PlatformRechargeService.php
Normal file
@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace App\Service\Wallet;
|
||||
|
||||
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');
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user