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

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

@@ -78,7 +78,7 @@ class AdminWithdrawOrder extends Backend
return $this->error(__('Parameter error'));
}
if ($this->request && $this->request->method() === 'POST') {
return $this->error('请使用通过/拒绝按钮审核');
return $this->error(__('Please use approve/reject buttons to review'));
}
$row = $this->loadWithRelations(intval(strval($id)));
if (!$row) {
@@ -111,7 +111,7 @@ class AdminWithdrawOrder extends Backend
return $this->error(__('You have no permission'));
}
if (intval($order['status'] ?? 0) !== 0) {
return $this->error('该提现订单已审核');
return $this->error(__('This withdraw order has already been reviewed'));
}
$remark = trim((string) $request->post('remark', ''));
Db::startTrans();
@@ -122,7 +122,7 @@ class AdminWithdrawOrder extends Backend
Db::rollback();
return $this->error($e->getMessage());
}
return $this->success('审核通过');
return $this->success(__('Approved'));
}
public function reject(WebmanRequest $request): Response
@@ -140,7 +140,7 @@ class AdminWithdrawOrder extends Backend
}
$remark = trim((string) $request->post('remark', ''));
if ($remark === '') {
return $this->error('请填写拒绝原因');
return $this->error(__('Please provide reject reason'));
}
$order = Db::name('admin_withdraw_order')->where('id', $id)->find();
if (!is_array($order)) {
@@ -150,7 +150,7 @@ class AdminWithdrawOrder extends Backend
return $this->error(__('You have no permission'));
}
if (intval($order['status'] ?? 0) !== 0) {
return $this->error('该提现订单已审核');
return $this->error(__('This withdraw order has already been reviewed'));
}
Db::startTrans();
try {
@@ -160,7 +160,7 @@ class AdminWithdrawOrder extends Backend
Db::rollback();
return $this->error($e->getMessage());
}
return $this->success('审核拒绝完成');
return $this->success(__('Rejected'));
}
public function stats(WebmanRequest $request): Response

View File

@@ -35,7 +35,7 @@ class BetOrder extends Backend
if ($response !== null) {
return $response;
}
return $this->error('注单由游戏接口生成,禁止后台手工新增');
return $this->error(__('Bet order is generated by game API; manual creation is not allowed'));
}
public function edit(WebmanRequest $request): Response
@@ -44,7 +44,7 @@ class BetOrder extends Backend
if ($response !== null) {
return $response;
}
return $this->error('注单不可编辑');
return $this->error(__('Bet order cannot be edited'));
}
public function del(WebmanRequest $request): Response
@@ -53,7 +53,7 @@ class BetOrder extends Backend
if ($response !== null) {
return $response;
}
return $this->error('注单不可删除');
return $this->error(__('Bet order cannot be deleted'));
}
public function sortable(WebmanRequest $request): Response
@@ -62,7 +62,7 @@ class BetOrder extends Backend
if ($response !== null) {
return $response;
}
return $this->error('不支持排序');
return $this->error(__('Sorting is not supported'));
}
/**

View File

@@ -93,7 +93,7 @@ class DepositOrder extends Backend
}
if ($this->request && $this->request->method() === 'POST') {
return $this->error('充值订单为自动入账,禁止直接修改,如需补单请走专用工具');
return $this->error(__('Deposit orders are auto-settled; direct modification is not allowed. Use the dedicated tool for manual adjustment.'));
}
$row = $this->loadWithRelations(intval(strval($id)));

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,