修改原有框架中英文映射
This commit is contained in:
@@ -64,7 +64,7 @@ class DiceRewardConfigController extends BaseController
|
||||
$data = is_array($model) ? $model : $model->toArray();
|
||||
return $this->success($data);
|
||||
} else {
|
||||
return $this->fail('未查找到信息');
|
||||
return $this->fail('not found');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -80,9 +80,9 @@ class DiceRewardConfigController extends BaseController
|
||||
$this->validate('save', $data);
|
||||
$result = $this->logic->add($data);
|
||||
if ($result) {
|
||||
return $this->success('添加成功');
|
||||
return $this->success('add success');
|
||||
} else {
|
||||
return $this->fail('添加失败');
|
||||
return $this->fail('add failed');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -98,9 +98,9 @@ class DiceRewardConfigController extends BaseController
|
||||
$this->validate('update', $data);
|
||||
$result = $this->logic->edit($data['id'], $data);
|
||||
if ($result) {
|
||||
return $this->success('修改成功');
|
||||
return $this->success('update success');
|
||||
} else {
|
||||
return $this->fail('修改失败');
|
||||
return $this->fail('update failed');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -114,7 +114,7 @@ class DiceRewardConfigController extends BaseController
|
||||
{
|
||||
$items = $request->post('items', []);
|
||||
if (! is_array($items)) {
|
||||
return $this->fail('参数 items 必须为数组');
|
||||
return $this->fail('parameter items must be an array');
|
||||
}
|
||||
$err = $this->logic->validateBatchUpdateItems($items);
|
||||
if ($err !== null) {
|
||||
@@ -124,7 +124,7 @@ class DiceRewardConfigController extends BaseController
|
||||
$this->validate('batch_update', array_merge($item, ['id' => $item['id']]));
|
||||
}
|
||||
$this->logic->batchUpdate($items);
|
||||
return $this->success('保存成功');
|
||||
return $this->success('save success');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -137,13 +137,13 @@ class DiceRewardConfigController extends BaseController
|
||||
{
|
||||
$ids = $request->post('ids', '');
|
||||
if (empty($ids)) {
|
||||
return $this->fail('请选择要删除的数据');
|
||||
return $this->fail('please select data to delete');
|
||||
}
|
||||
$result = $this->logic->destroy($ids);
|
||||
if ($result) {
|
||||
return $this->success('删除成功');
|
||||
return $this->success('delete success');
|
||||
} else {
|
||||
return $this->fail('删除失败');
|
||||
return $this->fail('delete failed');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -171,12 +171,12 @@ class DiceRewardConfigController extends BaseController
|
||||
{
|
||||
$items = $request->post('items', []);
|
||||
if (!is_array($items)) {
|
||||
return $this->fail('参数 items 必须为数组');
|
||||
return $this->fail('parameter items must be an array');
|
||||
}
|
||||
try {
|
||||
$rewardLogic = new DiceRewardLogic();
|
||||
$rewardLogic->batchUpdateWeights($items);
|
||||
return $this->success('保存成功');
|
||||
return $this->success('save success');
|
||||
} catch (\plugin\saiadmin\exception\ApiException $e) {
|
||||
return $this->fail($e->getMessage());
|
||||
}
|
||||
@@ -193,14 +193,14 @@ class DiceRewardConfigController extends BaseController
|
||||
{
|
||||
$items = $request->post('items', []);
|
||||
if (! is_array($items)) {
|
||||
return $this->fail('参数 items 必须为数组');
|
||||
return $this->fail('parameter items must be an array');
|
||||
}
|
||||
$err = $this->logic->validateBigwinWeightItems($items);
|
||||
if ($err !== null) {
|
||||
return $this->fail($err);
|
||||
}
|
||||
$this->logic->batchUpdateBigwinWeight($items);
|
||||
return $this->success('保存成功');
|
||||
return $this->success('save success');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -215,7 +215,7 @@ class DiceRewardConfigController extends BaseController
|
||||
try {
|
||||
$rewardLogic = new DiceRewardLogic();
|
||||
$result = $rewardLogic->createRewardReferenceFromConfig();
|
||||
return $this->success($result, '创建奖励对照成功');
|
||||
return $this->success($result, 'create reward mapping success');
|
||||
} catch (\plugin\saiadmin\exception\ApiException $e) {
|
||||
return $this->fail($e->getMessage());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user