对搜索返回的消息做中英双版本
This commit is contained in:
@@ -164,18 +164,18 @@ class AdminInfo extends Backend
|
||||
$receiveType = trim(is_string($request->post('receive_type', '')) ? $request->post('receive_type', '') : '');
|
||||
$idempotencyKey = trim(is_string($request->post('idempotency_key', '')) ? $request->post('idempotency_key', '') : '');
|
||||
if ($withdrawCoin === '' || $receiveAccount === '' || $receiveType === '' || $idempotencyKey === '') {
|
||||
return $this->error('参数缺失');
|
||||
return $this->error(__('Missing required parameters'));
|
||||
}
|
||||
if (mb_strlen($idempotencyKey) > 64) {
|
||||
return $this->error('幂等键过长');
|
||||
return $this->error(__('Idempotency key is too long'));
|
||||
}
|
||||
if (!is_numeric($withdrawCoin) || bccomp($withdrawCoin, '0', 2) <= 0) {
|
||||
return $this->error('提现金额必须大于0');
|
||||
return $this->error(__('Withdraw amount must be greater than 0'));
|
||||
}
|
||||
$withdrawCoin = bcadd($withdrawCoin, '0', 2);
|
||||
$allowedReceiveTypes = ['bank', 'ewallet', 'crypto'];
|
||||
if (!in_array($receiveType, $allowedReceiveTypes, true)) {
|
||||
return $this->error('收款类型不合法,仅支持 bank/ewallet/crypto');
|
||||
return $this->error(__('Invalid receive type; only bank/ewallet/crypto are supported'));
|
||||
}
|
||||
$remark = trim((string) $request->post('remark', ''));
|
||||
$admin = Db::name('admin')->field(['id', 'channel_id'])->where('id', $adminId)->find();
|
||||
@@ -185,14 +185,14 @@ class AdminInfo extends Backend
|
||||
$res = AdminWalletService::applyWithdraw($adminId, $channelId, $withdrawCoin, $receiveType, $receiveAccount, $idempotencyKey, $remark);
|
||||
if (($res['ok'] ?? false) !== true) {
|
||||
Db::rollback();
|
||||
return $this->error(strval($res['msg'] ?? '提现申请失败'));
|
||||
return $this->error(strval($res['msg'] ?? __('Withdraw apply failed')));
|
||||
}
|
||||
Db::commit();
|
||||
} catch (Throwable $e) {
|
||||
Db::rollback();
|
||||
return $this->error($e->getMessage());
|
||||
}
|
||||
return $this->success('提现申请已提交,待渠道超管审核', [
|
||||
return $this->success(__('Withdraw request submitted; pending channel super admin review'), [
|
||||
'order_id' => intval($res['order_id'] ?? 0),
|
||||
'order_no' => strval($res['order_no'] ?? ''),
|
||||
'idempotent_hit' => !empty($res['idempotent_hit']),
|
||||
|
||||
Reference in New Issue
Block a user