|
|
@@ -46,6 +46,7 @@ class Offline extends Api
|
|
|
{
|
|
|
$amount = $this->request->post('amount'); // 金额
|
|
|
$sign = $this->request->post('sign'); // 签名信
|
|
|
+ $address = $this->request->post('to_address'); // 地址
|
|
|
if(empty($sign)){
|
|
|
$this->error('参数错误');
|
|
|
}
|
|
|
@@ -77,7 +78,7 @@ class Offline extends Api
|
|
|
|
|
|
// 验签
|
|
|
$signMsg = "withdraw"; // 与前端约定的固定值
|
|
|
- if (!checkSign($signMsg, $sign, $user['address'])) {
|
|
|
+ if (!checkSign($signMsg, $sign, $address)) {
|
|
|
$this->error('签名校验失败');
|
|
|
}
|
|
|
|
|
|
@@ -85,11 +86,11 @@ class Offline extends Api
|
|
|
Db::startTrans();
|
|
|
try {
|
|
|
// 更新USDT和账变
|
|
|
- (new LedgerWalletModel())->changeWalletAccount($uid, Asset::USDT, -$amount, Action::UsdtWithdrawCash);
|
|
|
+ (new LedgerWalletModel())->changeWalletAccount($uid, Asset::TOKEN, -$amount, Action::UsdtWithdrawCash);
|
|
|
|
|
|
// 创建提现记录
|
|
|
$txHash = Random::uuid();
|
|
|
- (new OfflineWithdrawRecordModel())->createWithdraw($txHash, $uid, $amount, $real, $user['address'], 'usdt');
|
|
|
+ (new OfflineWithdrawRecordModel())->createWithdraw($txHash, $uid, $amount, $real, $address, 'usdt');
|
|
|
|
|
|
// 提交事务
|
|
|
Db::commit();
|