|
|
@@ -76,7 +76,7 @@ class ConfigController extends BaseController {
|
|
|
if (Yii::$app->request->post() && $form->load(Yii::$app->request->post(), '')) {
|
|
|
if ($form->updateBase()) {
|
|
|
Config::updateToCache();
|
|
|
- return static::notice('更新站点设置成功');
|
|
|
+ return static::notice(Yii::t('ctx', 'successfully'));
|
|
|
} else {
|
|
|
return static::notice(Form::formatErrorsForApi($form->getErrors()), 422);
|
|
|
}
|
|
|
@@ -140,7 +140,7 @@ class ConfigController extends BaseController {
|
|
|
if (Yii::$app->request->post() && $form->load(Yii::$app->request->post(), '')) {
|
|
|
if ($form->updateBonus()) {
|
|
|
Config::updateToCache();
|
|
|
- return static::notice('更新奖金配置成功');
|
|
|
+ return static::notice(Yii::t('ctx', 'successfully'));
|
|
|
} else {
|
|
|
return static::notice(Form::formatErrorsForApi($form->getErrors()), 422);
|
|
|
}
|
|
|
@@ -158,7 +158,7 @@ class ConfigController extends BaseController {
|
|
|
if (Yii::$app->request->post() && $form->load(Yii::$app->request->post(), '')) {
|
|
|
if ($form->updateBonus()) {
|
|
|
DeclarationLevel::updateToCache();
|
|
|
- return static::notice('更新级别奖金配置成功');
|
|
|
+ return static::notice(Yii::t('ctx', 'successfully'));
|
|
|
} else {
|
|
|
return static::notice(Form::formatErrorsForApi($form->getErrors()), 422);
|
|
|
}
|
|
|
@@ -176,7 +176,7 @@ class ConfigController extends BaseController {
|
|
|
if (Yii::$app->request->post() && $form->load(Yii::$app->request->post(), '')) {
|
|
|
if ($form->updateBonus()) {
|
|
|
Cache::updateEmpLevelConfig();
|
|
|
- return static::notice('更新聘级奖金配置成功');
|
|
|
+ return static::notice(Yii::t('ctx', 'successfully'));
|
|
|
} else {
|
|
|
return static::notice(Form::formatErrorsForApi($form->getErrors()), 422);
|
|
|
}
|
|
|
@@ -194,7 +194,7 @@ class ConfigController extends BaseController {
|
|
|
if (Yii::$app->request->post() && $form->load(Yii::$app->request->post(), '')) {
|
|
|
if ($form->updateBonus()) {
|
|
|
StarCrownLevel::updateToCache();
|
|
|
- return static::notice('更新星级奖金配置成功');
|
|
|
+ return static::notice(Yii::t('ctx', 'successfully'));
|
|
|
} else {
|
|
|
return static::notice(Form::formatErrorsForApi($form->getErrors()), 422);
|
|
|
}
|
|
|
@@ -375,7 +375,7 @@ class ConfigController extends BaseController {
|
|
|
if (Yii::$app->request->post() && $form->load(Yii::$app->request->post(), '')) {
|
|
|
if ($form->updateTransfer()) {
|
|
|
Config::updateToCache();
|
|
|
- return static::notice('更新转账配置成功');
|
|
|
+ return static::notice(Yii::t('ctx', 'successfully'));
|
|
|
} else {
|
|
|
return static::notice(Form::formatErrorsForApi($form->getErrors()), 422);
|
|
|
}
|
|
|
@@ -439,7 +439,7 @@ class ConfigController extends BaseController {
|
|
|
if (Yii::$app->request->post() && $form->load(Yii::$app->request->post(), '')) {
|
|
|
if ($form->updateOther()) {
|
|
|
Config::updateToCache();
|
|
|
- return static::notice('更新其他配置成功');
|
|
|
+ return static::notice(Yii::t('ctx', 'successfully'));
|
|
|
} else {
|
|
|
return static::notice(Form::formatErrorsForApi($form->getErrors()), 422);
|
|
|
}
|
|
|
@@ -530,7 +530,7 @@ class ConfigController extends BaseController {
|
|
|
return static::notice('操作失败,请重试');
|
|
|
}
|
|
|
}
|
|
|
- return static::notice('Illegal request'); // 非法请求
|
|
|
+ return static::notice(Yii::t('ctx', 'illegalRequest'), 405);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -553,7 +553,7 @@ class ConfigController extends BaseController {
|
|
|
public function actionDecRoleEdit() {
|
|
|
$id = Yii::$app->request->get('id');
|
|
|
if (Yii::$app->request->isPost) {
|
|
|
- return static::edit(DecRoleForm::class, '报单中心级别修改成功', null, null, null, function () {
|
|
|
+ return static::edit(DecRoleForm::class, Yii::t('ctx', 'successfully'), null, null, null, function () {
|
|
|
DecRole::updateToCache();
|
|
|
});
|
|
|
}
|
|
|
@@ -568,12 +568,12 @@ class ConfigController extends BaseController {
|
|
|
*/
|
|
|
public function actionDecLevelAdd() {
|
|
|
if (Yii::$app->request->isPost) {
|
|
|
- return static::edit(DecLevelForm::class, '会员级别添加成功', null, null, null, function () {
|
|
|
+ return static::edit(DecLevelForm::class, Yii::t('ctx', 'successfully'), null, null, null, function () {
|
|
|
DeclarationLevel::updateToCache();
|
|
|
// Log::adminHandle('添加会员级别', 1);
|
|
|
});
|
|
|
}
|
|
|
- return static::notice('非发请求', 405);
|
|
|
+ return static::notice(Yii::t('ctx', 'illegalRequest'), 405);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -584,7 +584,7 @@ class ConfigController extends BaseController {
|
|
|
public function actionDecLevelEdit() {
|
|
|
$id = Yii::$app->request->get('id');
|
|
|
if (Yii::$app->request->isPost) {
|
|
|
- return static::edit(DecLevelForm::class, '会员级别修改成功', null, null, null, function () {
|
|
|
+ return static::edit(DecLevelForm::class, Yii::t('ctx', 'successfully'), null, null, null, function () {
|
|
|
DeclarationLevel::updateToCache();
|
|
|
// Log::adminHandle('编辑报单级别参数', 1);
|
|
|
});
|
|
|
@@ -630,7 +630,7 @@ class ConfigController extends BaseController {
|
|
|
*/
|
|
|
public function actionEmpLevelAdd() {
|
|
|
if (Yii::$app->request->isPost) {
|
|
|
- return static::edit(EmployLevelForm::class, '会员聘级添加成功', null, null, null, function () {
|
|
|
+ return static::edit(EmployLevelForm::class, Yii::t('ctx', 'successfully'), null, null, null, function () {
|
|
|
EmployLevel::updateToCache();
|
|
|
// Log::adminHandle('添加会员聘级', 1);
|
|
|
});
|
|
|
@@ -648,7 +648,7 @@ class ConfigController extends BaseController {
|
|
|
public function actionEmpLevelEdit() {
|
|
|
$id = Yii::$app->request->get('id');
|
|
|
if (Yii::$app->request->isPost) {
|
|
|
- return static::edit(EmployLevelForm::class, '会员聘级修改成功', null, null, null, function () {
|
|
|
+ return static::edit(EmployLevelForm::class, Yii::t('ctx', 'successfully'), null, null, null, function () {
|
|
|
EmployLevel::updateToCache();
|
|
|
// Log::adminHandle('编辑会员聘级', 1);
|
|
|
});
|
|
|
@@ -718,7 +718,7 @@ class ConfigController extends BaseController {
|
|
|
*/
|
|
|
public function actionWithdrawLevelAdd() {
|
|
|
if (Yii::$app->request->isPost) {
|
|
|
- return static::edit(WithdrawLevelForm::class, '提现金额等级添加成功', null, null, null, function () {
|
|
|
+ return static::edit(WithdrawLevelForm::class, Yii::t('ctx', 'successfully'), null, null, null, function () {
|
|
|
WithdrawLevel::updateToCache();
|
|
|
// Log::adminHandle('添加提现金额等级', 1);
|
|
|
});
|
|
|
@@ -733,7 +733,7 @@ class ConfigController extends BaseController {
|
|
|
public function actionWithdrawLevelEdit() {
|
|
|
$id = Yii::$app->request->get('id');
|
|
|
if (Yii::$app->request->isPost) {
|
|
|
- return static::edit(WithdrawLevelForm::class, '提现金额等级修改成功', null, null, null, function () {
|
|
|
+ return static::edit(WithdrawLevelForm::class, Yii::t('ctx', 'successfully'), null, null, null, function () {
|
|
|
WithdrawLevel::updateToCache();
|
|
|
// Log::adminHandle('编辑提现金额等级', 1);
|
|
|
});
|
|
|
@@ -775,7 +775,7 @@ class ConfigController extends BaseController {
|
|
|
$id = Yii::$app->request->get('id');
|
|
|
$regType = RegType::findOneAsArray('ID=:ID', [':ID' => $id]);
|
|
|
if (!$regType) {
|
|
|
- return static::notice('The data does not exist', 400); // 数据不存在
|
|
|
+ return static::notice(Yii::t('ctx', 'dataNotExists'), 400);
|
|
|
}
|
|
|
return static::notice(['id' => $regType['ID'], 'typeName' => $regType['TYPE_NAME'], 'isPact' => $regType['IS_PACT'], 'monthAmount' => $regType['MONTH_LIMIT_AMOUNT'], 'yearAmount' => $regType['YEAR_LIMIT_AMOUNT'], 'remark' => $regType['REMARK']]);
|
|
|
}
|
|
|
@@ -794,12 +794,12 @@ class ConfigController extends BaseController {
|
|
|
$formModel->id = $id;
|
|
|
if ($formModel->load(Yii::$app->request->post(), '') && $result = $formModel->edit()) {
|
|
|
// Log::adminHandle('修改注册类型,ID为:' . $result['ID']);
|
|
|
- return static::notice('修改注册类型成功');
|
|
|
+ return static::notice(Yii::t('ctx', 'successfully'));
|
|
|
} else {
|
|
|
return static::notice(Form::formatErrorsForApi($formModel->getErrors()), 400);
|
|
|
}
|
|
|
}
|
|
|
- return static::notice('Illegal request', 400); // 非法请求
|
|
|
+ return static::notice(Yii::t('ctx', 'illegalRequest'), 405);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -862,7 +862,7 @@ class ConfigController extends BaseController {
|
|
|
if (\Yii::$app->request->isPost && $form->load($post, '')) {
|
|
|
if ($form->updateExchangeRate()) {
|
|
|
Config::updateToCache();
|
|
|
- return static::notice('更新汇率配置成功');
|
|
|
+ return static::notice(Yii::t('ctx', 'successfully'));
|
|
|
} else {
|
|
|
return static::notice(Form::formatErrorsForApi($form->getErrors()), 422);
|
|
|
}
|