|
@@ -155,7 +155,7 @@ class LedgerWalletModel extends Model
|
|
|
* @return void
|
|
* @return void
|
|
|
* @throws Exception
|
|
* @throws Exception
|
|
|
*/
|
|
*/
|
|
|
- public function setChangeFrozen(int $uid, string $amount, int $action, int $token, string $icn, int $from_id = 0)
|
|
|
|
|
|
|
+ public function setChangeFrozen(int $uid, string $amount, int $action, int $type, string $icn, int $from_id = 0)
|
|
|
{
|
|
{
|
|
|
$available = $this->getWallet($uid);
|
|
$available = $this->getWallet($uid);
|
|
|
$ledgerWalletModel = new LedgerWalletModel();
|
|
$ledgerWalletModel = new LedgerWalletModel();
|
|
@@ -176,7 +176,7 @@ class LedgerWalletModel extends Model
|
|
|
$walletUpdate = ['token'=> bcadd($totalAmount, -$amount, 6), 'frozen' => 0];
|
|
$walletUpdate = ['token'=> bcadd($totalAmount, -$amount, 6), 'frozen' => 0];
|
|
|
//添加茶宝账变记录
|
|
//添加茶宝账变记录
|
|
|
$subAmount = $token = bcsub($amount, $available['frozen'], 6);
|
|
$subAmount = $token = bcsub($amount, $available['frozen'], 6);
|
|
|
- $this->changeWalletAccount($uid, Asset::TOKEN, -$subAmount, $token, $from_id);
|
|
|
|
|
|
|
+ $this->changeWalletAccount($uid, Asset::TOKEN, -$subAmount, $type, $from_id);
|
|
|
}
|
|
}
|
|
|
//添加冻结
|
|
//添加冻结
|
|
|
$newAmount = $walletUpdate['frozen'];
|
|
$newAmount = $walletUpdate['frozen'];
|
|
@@ -192,7 +192,7 @@ class LedgerWalletModel extends Model
|
|
|
$newAmount = $amount; //剩余的冻结金额
|
|
$newAmount = $amount; //剩余的冻结金额
|
|
|
//添加冻结
|
|
//添加冻结
|
|
|
$walletUpdate =['token' => $chabao, 'frozen' =>$newAmount];
|
|
$walletUpdate =['token' => $chabao, 'frozen' =>$newAmount];
|
|
|
- $this->changeWalletAccount($uid, Asset::TOKEN, $sunAmount, $token, $from_id);
|
|
|
|
|
|
|
+ $this->changeWalletAccount($uid, Asset::TOKEN, $sunAmount, $type, $from_id);
|
|
|
$result = true;
|
|
$result = true;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -207,7 +207,6 @@ class LedgerWalletModel extends Model
|
|
|
'create_time' => time(),
|
|
'create_time' => time(),
|
|
|
'action' => $action
|
|
'action' => $action
|
|
|
]);
|
|
]);
|
|
|
-
|
|
|
|
|
return [$token, $frozen];
|
|
return [$token, $frozen];
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|