对搜索返回的消息做中英双版本

This commit is contained in:
2026-04-28 15:22:50 +08:00
parent 85133ee92b
commit 9bc439ea5e
32 changed files with 575 additions and 183 deletions

View File

@@ -84,7 +84,7 @@ class WithdrawOrder extends Backend
if ($this->request && $this->request->method() === 'POST') {
// 历史 CRUD 的 POST 编辑已被 approve/reject 替代,这里阻止直接改金额绕过审核流程
return $this->error('请使用通过/拒绝按钮完成审核');
return $this->error(__('Please use approve/reject buttons to complete the review'));
}
$row = $this->loadWithRelations(intval(strval($id)));
@@ -119,13 +119,13 @@ class WithdrawOrder extends Backend
$newAmount = $this->decimalParam($request->post('amount'), '0');
$newFee = $this->decimalParam($request->post('fee'), '0');
if (bccomp($newAmount, '0', 2) <= 0) {
return $this->error('申请金额必须大于 0');
return $this->error(__('Apply amount must be greater than 0'));
}
if (bccomp($newFee, '0', 2) < 0) {
return $this->error('手续费不能为负');
return $this->error(__('Fee cannot be negative'));
}
if (bccomp($newFee, $newAmount, 2) > 0) {
return $this->error('手续费不能大于申请金额');
return $this->error(__('Fee cannot be greater than apply amount'));
}
$newActual = bcsub($newAmount, $newFee, 2);
@@ -141,12 +141,12 @@ class WithdrawOrder extends Backend
}
$currentStatus = $this->intParam($order['status'] ?? 0);
if ($currentStatus !== 0) {
return $this->error('该订单已审核,无需重复操作');
return $this->error(__('This order has already been reviewed'));
}
$userId = $this->intParam($order['user_id'] ?? 0);
if ($userId <= 0) {
return $this->error('订单缺少用户信息');
return $this->error(__('Order is missing user info'));
}
$oldAmount = bcadd(strval($order['amount'] ?? '0'), '0', 2);
$diff = bcsub($newAmount, $oldAmount, 2);
@@ -173,12 +173,12 @@ class WithdrawOrder extends Backend
$userRow = Db::name('user')->where('id', $userId)->find();
if (!$userRow) {
Db::rollback();
return $this->error('关联用户不存在');
return $this->error(__('Related user does not exist'));
}
$beforeCoin = bcadd(strval($userRow['coin'] ?? '0'), '0', 2);
if (bccomp($beforeCoin, $diff, 2) < 0) {
Db::rollback();
return $this->error('用户余额不足以补扣调整差额');
return $this->error(__('User balance is insufficient to cover the adjustment difference'));
}
$afterCoin = bcsub($beforeCoin, $diff, 2);
Db::name('user')->where('id', $userId)->update([
@@ -208,7 +208,7 @@ class WithdrawOrder extends Backend
$userRow = Db::name('user')->where('id', $userId)->find();
if (!$userRow) {
Db::rollback();
return $this->error('关联用户不存在');
return $this->error(__('Related user does not exist'));
}
$beforeCoin = bcadd(strval($userRow['coin'] ?? '0'), '0', 2);
$afterCoin = bcadd($beforeCoin, $abs, 2);
@@ -251,7 +251,7 @@ class WithdrawOrder extends Backend
return $this->error($e->getMessage());
}
return $this->success('审核通过', [
return $this->success(__('Approved'), [
'id' => $id,
'amount' => $newAmount,
'fee' => $newFee,
@@ -281,7 +281,7 @@ class WithdrawOrder extends Backend
$remarkRaw = $request->post('remark');
$remark = is_string($remarkRaw) ? trim($remarkRaw) : '';
if ($remark === '') {
return $this->error('请填写拒绝原因');
return $this->error(__('Please provide reject reason'));
}
$order = Db::name('withdraw_order')->where('id', $id)->find();
@@ -293,12 +293,12 @@ class WithdrawOrder extends Backend
}
$currentStatus = $this->intParam($order['status'] ?? 0);
if ($currentStatus !== 0) {
return $this->error('该订单已审核,无需重复操作');
return $this->error(__('This order has already been reviewed'));
}
$userId = $this->intParam($order['user_id'] ?? 0);
if ($userId <= 0) {
return $this->error('订单缺少用户信息');
return $this->error(__('Order is missing user info'));
}
$amount = bcadd(strval($order['amount'] ?? '0'), '0', 2);
$channelIdRaw = $order['channel_id'] ?? null;
@@ -315,7 +315,7 @@ class WithdrawOrder extends Backend
$userRow = Db::name('user')->where('id', $userId)->find();
if (!$userRow) {
Db::rollback();
return $this->error('关联用户不存在');
return $this->error(__('Related user does not exist'));
}
$beforeCoin = bcadd(strval($userRow['coin'] ?? '0'), '0', 2);
$afterCoin = bcadd($beforeCoin, $amount, 2);
@@ -355,7 +355,7 @@ class WithdrawOrder extends Backend
return $this->error($e->getMessage());
}
return $this->success('审核已拒绝', [
return $this->success(__('Rejected'), [
'id' => $id,
'status' => 2,
'remark' => $remark,