kevin_zhangl 2 лет назад
Родитель
Сommit
62cc4437ca

+ 3 - 2
backendApi/config/menu.php

@@ -499,8 +499,9 @@ return [
             ['name'=>'站点设置', 'class'=>'', 'icon'=>'', 'controller'=>'config', 'action'=>'base', 'routePath'=>'config/base', 'show'=>1, 'wiki' => 'siteConfig'],
             ['name'=>'奖金设置', 'class'=>'', 'icon'=>'', 'controller'=>'config', 'action'=>'bonus-opt', 'routePath'=>'config/bonus-opt', 'show'=>1, 'wiki' => 'bonusConfig'],
             ['name'=>'奖金基本配置', 'class'=>'', 'icon'=>'', 'controller'=>'config', 'action'=>'bonus', 'routePath'=>'config/bonus', 'show'=>0,],
-//            ['name'=>'区域/复销奖配置', 'class'=>'', 'icon'=>'', 'controller'=>'config', 'action'=>'bonus-dec-level', 'routePath'=>'config/bonus-dec-level', 'show'=>0,],
-//            ['name'=>'育成/车房/养老配置', 'class'=>'', 'icon'=>'', 'controller'=>'config', 'action'=>'bonus-emp-level', 'routePath'=>'config/bonus-emp-level', 'show'=>0,],
+            ['name'=>'皇冠星级配置', 'class'=>'', 'icon'=>'', 'controller'=>'config', 'action'=>'bonus-dec-level', 'routePath'=>'config/bonus-crown-level', 'show'=>0,],
+            ['name'=>'级别配置', 'class'=>'', 'icon'=>'', 'controller'=>'config', 'action'=>'bonus-dec-level', 'routePath'=>'config/bonus-dec-level', 'show'=>0,],
+            ['name'=>'管理星级配置', 'class'=>'', 'icon'=>'', 'controller'=>'config', 'action'=>'bonus-emp-level', 'routePath'=>'config/bonus-emp-level', 'show'=>0,],
 //            ['name'=>'期数配置', 'class'=>'', 'icon'=>'', 'controller'=>'config', 'action'=>'period', 'routePath'=>'config/period', 'show'=>1,],
 //            ['name'=>'会员注册类型配置', 'class'=>'', 'icon'=>'', 'controller'=>'config', 'action'=>'reg-type', 'routePath'=>'config/reg-type', 'show'=>1,],
 //            ['name'=>'会员注册类型编辑', 'class'=>'', 'icon'=>'', 'controller'=>'config', 'action'=>'reg-type-edit', 'routePath'=>'config/reg-type-edit', 'show'=>0,],

+ 1 - 1
backendApi/config/urlManagerRules.php

@@ -291,7 +291,7 @@ return [
             'POST emp-level-delete' => 'emp-level-delete',
             'POST bonus-dec-level' => 'bonus-dec-level',
             'POST bonus-emp-level' => 'bonus-emp-level',
-            'POST bonus-star-level' => 'bonus-star-level',
+            'POST bonus-crown-level' => 'bonus-crown-level',
             'GET clear-data' => 'clear-data',
             'GET clear-cache' => 'clear-cache',
             'GET clear-table-cache' => 'clear-table-cache',

+ 20 - 20
backendApi/modules/v1/controllers/ConfigController.php

@@ -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);
             }

+ 6 - 3
common/models/forms/EmployLevelForm.php

@@ -131,9 +131,12 @@ class EmployLevelForm extends Model {
 //                    $empLevelModel->CF_PERCENT = $value['CF_PERCENT'];
 //                    $empLevelModel->LX_BASE_NUM = $value['LX_BASE_NUM'];
 //                    $empLevelModel->LX_PERCENT = $value['LX_PERCENT'];
-                    $empLevelModel->RX_PERCENT = $value['RX_PERCENT'];
-                    $empLevelModel->LEVEL_SCORE = $value['LEVEL_SCORE'];
-                    $empLevelModel->UPGRADE_SCORE = $value['UPGRADE_SCORE'];
+//                    $empLevelModel->RX_PERCENT = $value['RX_PERCENT'];
+//                    $empLevelModel->LEVEL_SCORE = $value['LEVEL_SCORE'];
+//                    $empLevelModel->UPGRADE_SCORE = $value['UPGRADE_SCORE'];
+                    $empLevelModel->ACHIEVE_MEMBER_NUM = $value['ACHIEVE_MEMBER_NUM'];
+                    $empLevelModel->ACHIEVE_PERF_PV = $value['ACHIEVE_PERF_PV'];
+                    $empLevelModel->ACHIEVE_PV = $value['ACHIEVE_PV'];
                     $empLevelModel->BS_PERCENT = $value['BS_PERCENT'];   // 蓝星奖比例
                     $empLevelModel->GARAGE_PERCENT = $value['GARAGE_PERCENT'];  // 车奖比例
                     $empLevelModel->TOURISM_PERCENT = $value['TOURISM_PERCENT'];  // 旅游奖比例