用户账变 用户钱包

This commit is contained in:
cano
2024-03-10 00:44:58 +08:00
parent 025dab4c2c
commit 6d242ae973
17 changed files with 1617 additions and 16 deletions

View File

@ -303,13 +303,22 @@ class WalletPlatformUserTransactionModel extends WalletBaseModel
if ($resWalletPlatformUserTransactionModel->type != self::TYPE_WITHDRAW) throw new ModelException('type error');
if ($resWalletPlatformUserTransactionModel->status != self::STATUS_CHAIN_WAITING) throw new ModelException('status error');
//用户账变处理
$resWalletPlatformUserTransactionModel->status = $status;
$resWalletPlatformUserTransactionModel->save();
$updateItems = [
'id' => $resWalletPlatformUserTransactionModel->id,
'status' => $status,
'entered_amount' => $resWalletAddrTransactionModel->entered_amount,
'fee_amount' => Db::raw('received_amount - '.$resWalletAddrTransactionModel->entered_amount),
];
$res = $this->updateItem($updateItems);
if(!$res) {
Log::error('listenWithdrawCallbackErr', $updateItems);
return;
}
//平台余额和账变处理
$oWalletPlatformBalanceTransactionModel = new WalletPlatformBalanceTransactionModel();
if ($status == self::STATUS_SUCCESS) { //成功
$oWalletPlatformBalanceTransactionModel->withdrawSuccByUserTransactionId($id);
$oWalletPlatformBalanceTransactionModel->withdrawSuccByUserTransactionId($id,$resWalletAddrTransactionModel->entered_amount);
} else { //失败
$oWalletPlatformBalanceTransactionModel->withdrawErrByUserTransactionId($id);
}