用户账变 用户钱包
This commit is contained in:
@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user