|
|
@@ -198,20 +198,24 @@ class CashClass extends BaseClass
|
|
|
|
|
|
public static function rollback($cash, $shop, $transaction, $cashAmount, $remark)
|
|
|
{
|
|
|
+ $mainId = $shop->mainId ?? 0;
|
|
|
+ $main = MainClass::getLockById($mainId);
|
|
|
+ if (empty($main)) {
|
|
|
+ util::fail('没有main信息');
|
|
|
+ }
|
|
|
$cash->remark = $remark;
|
|
|
$cash->status = self::STATUS_CHECK_NO;
|
|
|
$cash->save();
|
|
|
//冻结金额回滚
|
|
|
- $shop->freezeBalance = bcsub($shop->freezeBalance, $cashAmount, 2);
|
|
|
- $currentBalance = bcadd($shop->balance, $cashAmount, 2);
|
|
|
- $shop->balance = $currentBalance;
|
|
|
- $currentTxBalance = bcadd($shop->txBalance, $cashAmount, 2);
|
|
|
- $shop->txBalance = $currentTxBalance;
|
|
|
- $shop->save();
|
|
|
+ $main->freezeBalance = bcsub($main->freezeBalance, $cashAmount, 2);
|
|
|
+ $currentBalance = bcadd($main->balance, $cashAmount, 2);
|
|
|
+ $main->balance = $currentBalance;
|
|
|
+ $currentTxBalance = bcadd($main->txBalance, $cashAmount, 2);
|
|
|
+ $main->txBalance = $currentTxBalance;
|
|
|
+ $main->save();
|
|
|
|
|
|
$sjId = $shop->sjId;
|
|
|
$shopId = $shop->id;
|
|
|
- $mainId = $shop->mainId ?? 0;
|
|
|
$tx = dict::getDict('yeTx', 'can');
|
|
|
$ptStyle = $shop->ptStyle ?? dict::getDict('ptStyle', 'hd');
|
|
|
$capitalType = dict::getDict('capitalType', 'xhDrawCash', 'id');
|
|
|
@@ -228,7 +232,7 @@ class CashClass extends BaseClass
|
|
|
'event' => "提现回滚",
|
|
|
'sjId' => $sjId,
|
|
|
'shopId' => $shopId,
|
|
|
- 'mainId'=>$mainId,
|
|
|
+ 'mainId' => $mainId,
|
|
|
'tx' => $tx,
|
|
|
'ptStyle' => $ptStyle,
|
|
|
];
|