对搜索返回的消息做中英双版本
This commit is contained in:
@@ -234,16 +234,16 @@ class User extends Backend
|
||||
$opRaw = $request->post('op');
|
||||
$op = is_string($opRaw) ? trim($opRaw) : '';
|
||||
if (!in_array($op, ['credit', 'deduct'], true)) {
|
||||
return $this->error('操作类型不正确');
|
||||
return $this->error(__('Invalid operation type'));
|
||||
}
|
||||
|
||||
$amountRaw = $request->post('amount');
|
||||
$amountText = is_string($amountRaw) || is_numeric($amountRaw) ? trim(strval($amountRaw)) : '';
|
||||
if ($amountText === '' || !is_numeric($amountText)) {
|
||||
return $this->error('金额格式不正确');
|
||||
return $this->error(__('Invalid amount format'));
|
||||
}
|
||||
if (bccomp($amountText, '0', 2) <= 0) {
|
||||
return $this->error('金额必须大于0');
|
||||
return $this->error(__('Amount must be greater than 0'));
|
||||
}
|
||||
|
||||
$remarkRaw = $request->post('remark');
|
||||
@@ -257,7 +257,7 @@ class User extends Backend
|
||||
|
||||
$lock = GameHotDataRedis::userAdminMutationLockTry($userId);
|
||||
if (!$lock['acquired']) {
|
||||
return $this->error('该用户正在被其他管理员操作(钱包/并发保存),请稍后再试');
|
||||
return $this->error(__('This user is being operated by another admin (wallet/concurrent save); please try again later'));
|
||||
}
|
||||
|
||||
try {
|
||||
@@ -284,7 +284,7 @@ class User extends Backend
|
||||
$direction = 1;
|
||||
} else {
|
||||
if (bccomp($before, $delta, 2) < 0) {
|
||||
return $this->error('余额不足,扣点失败');
|
||||
return $this->error(__('Insufficient balance; deduction failed'));
|
||||
}
|
||||
$after = bcsub($before, $delta, 2);
|
||||
$bizType = 'admin_deduct';
|
||||
@@ -306,7 +306,7 @@ class User extends Backend
|
||||
]);
|
||||
if ($affected !== 1) {
|
||||
Db::rollback();
|
||||
return $this->error('保存失败:该用户余额已被其他请求修改(如下注、派彩或其他管理员已保存),请刷新后重试');
|
||||
return $this->error(__('Save failed: user balance changed by another request; please refresh and retry'));
|
||||
}
|
||||
|
||||
Db::name('user_wallet_record')->insert([
|
||||
@@ -332,7 +332,7 @@ class User extends Backend
|
||||
|
||||
GameHotDataCoordinator::afterUserCommitted($userId);
|
||||
|
||||
return $this->success('钱包调整成功', [
|
||||
return $this->success(__('Wallet adjusted successfully'), [
|
||||
'user_id' => $userId,
|
||||
'coin_before' => self::formatAmountForDisplay($before),
|
||||
'coin_after' => self::formatAmountForDisplay($after),
|
||||
|
||||
@@ -35,7 +35,7 @@ class UserWalletRecord extends Backend
|
||||
if ($response !== null) {
|
||||
return $response;
|
||||
}
|
||||
return $this->error('钱包流水仅允许业务入账,禁止后台手工新增');
|
||||
return $this->error(__('Wallet records are business-generated; manual creation is not allowed'));
|
||||
}
|
||||
|
||||
public function edit(WebmanRequest $request): Response
|
||||
@@ -44,7 +44,7 @@ class UserWalletRecord extends Backend
|
||||
if ($response !== null) {
|
||||
return $response;
|
||||
}
|
||||
return $this->error('钱包流水不可编辑');
|
||||
return $this->error(__('Wallet record cannot be edited'));
|
||||
}
|
||||
|
||||
public function del(WebmanRequest $request): Response
|
||||
@@ -53,7 +53,7 @@ class UserWalletRecord extends Backend
|
||||
if ($response !== null) {
|
||||
return $response;
|
||||
}
|
||||
return $this->error('钱包流水不可删除');
|
||||
return $this->error(__('Wallet record cannot be deleted'));
|
||||
}
|
||||
|
||||
public function sortable(WebmanRequest $request): Response
|
||||
@@ -62,7 +62,7 @@ class UserWalletRecord extends Backend
|
||||
if ($response !== null) {
|
||||
return $response;
|
||||
}
|
||||
return $this->error('不支持排序');
|
||||
return $this->error(__('Sorting is not supported'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user