wallet_fix

This commit is contained in:
cano
2024-03-08 01:14:04 +08:00
parent b14c000bc3
commit aa40614965
2 changed files with 18 additions and 7 deletions

View File

@ -27,6 +27,7 @@ class WalletPlatformBalanceTransactionModel extends WalletBaseModel
'from_user_transaction_id',
'from_uid',
'wallet_addr',
'from_wallet_transaction_id',
'received_amount',
'entered_amount',
'fee_amount',
@ -69,6 +70,7 @@ class WalletPlatformBalanceTransactionModel extends WalletBaseModel
$entered_amount,
$platform_id,
$currency_code,
$from_uid = '',
$from_user_transaction_id = '',
$from_wallet_addr_id = '',
$wallet_addr = '',
@ -109,6 +111,7 @@ class WalletPlatformBalanceTransactionModel extends WalletBaseModel
'currency_type' => $resWalletPlatformBalanceModel->currency_type,
'from_wallet_addr_id' => $from_wallet_addr_id,
'from_user_transaction_id' => $from_user_transaction_id,
'from_uid' => $from_uid,
'wallet_addr' => $wallet_addr,
'received_amount' => $received_amount,
'entered_amount' => $entered_amount,
@ -130,11 +133,12 @@ class WalletPlatformBalanceTransactionModel extends WalletBaseModel
$amount,
$platform_id,
$currency_code,
$uid,
): \Illuminate\Database\Eloquent\Model|\Illuminate\Database\Eloquent\Builder|bool
{
try {
Db::beginTransaction();
$resModel = $this->addPlatformTransaction(self::TYPE_USER_WITHDRAW, self::STATUS_WAITING_QUEUE, $amount,$amount, $platform_id, $currency_code);
$resModel = $this->addPlatformTransaction(self::TYPE_USER_WITHDRAW, self::STATUS_WAITING_QUEUE, $amount,$amount, $platform_id, $currency_code,$uid);
if(!$resModel) throw new ModelException('addPlatformTransaction error');
$oWalletPlatformBalanceModel = new WalletPlatformBalanceModel();
$res = $oWalletPlatformBalanceModel->findPlatformBalance($platform_id,$currency_code);
@ -213,6 +217,8 @@ class WalletPlatformBalanceTransactionModel extends WalletBaseModel
}
function newRechargePlatformTransaction(
$resWalletAddrTransactionModel,
$resWalletPlatformUserTransactionModel,
$amount,
$platform_id,
$currency_code,
@ -220,7 +226,7 @@ class WalletPlatformBalanceTransactionModel extends WalletBaseModel
{
try {
Db::beginTransaction();
$resModel = $this->addPlatformTransaction(self::TYPE_USER_RECHARGE, self::STATUS_SUCCESS, $amount,$amount, $platform_id, $currency_code);
$resModel = $this->addPlatformTransaction(self::TYPE_USER_RECHARGE, self::STATUS_SUCCESS, $amount,$amount, $platform_id, $currency_code,$resWalletPlatformUserTransactionModel->uid,$resWalletPlatformUserTransactionModel->id,$resWalletAddrTransactionModel->wallet_addr_id,$resWalletAddrTransactionModel->wallet_addr);
if(!$resModel) throw new ModelException('addPlatformTransaction error');
$oWalletPlatformBalanceModel = new WalletPlatformBalanceModel();
$resWalletPlatformBalanceModel = $oWalletPlatformBalanceModel->findPlatformBalance($platform_id,$currency_code);