Bladeren bron

Merge branch 'feature/new-backend-adaptation' into feature/new-backend-adaptation-joway-1

joway 2 jaren geleden
bovenliggende
commit
b65440f95c

+ 16 - 15
backendApi/config/menu.php

@@ -355,11 +355,11 @@ return [
             //['name'=>'发票调整管理', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'invoice-balance-audit', 'routePath'=>'finance/invoice-balance-audit', 'show'=>1,],
             //['name'=>'发票调整添加', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'invoice-balance-audit-add', 'routePath'=>'finance/invoice-balance-audit-add', 'show'=>0,],
             ['name'=>'提现导出', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'withdraw-export', 'routePath'=>'finance/withdraw-export', 'show'=>0,],
-            ['name'=>'交易类型管理', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'deal-type', 'routePath'=>'finance/deal-type', 'show'=>1, 'wiki' => 'dealTypeManagement'],
-            ['name'=>'交易类型添加', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'deal-type-add', 'routePath'=>'finance/deal-type-add', 'show'=>0,],
-            ['name'=>'交易类型修改', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'deal-type-edit', 'routePath'=>'finance/deal-type-edit', 'show'=>0,],
-            ['name'=>'Historical bonus balance', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'history-bonus', 'routePath'=>'finance/history-bonus', 'show'=>1, 'wiki' => 'historicalBonusBalance'],// 历史奖金余额
-            ['name'=>'历史奖金余额导出', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'history-bonus-export', 'routePath'=>'finance/history-bonus-export', 'show'=>0,],
+//            ['name'=>'交易类型管理', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'deal-type', 'routePath'=>'finance/deal-type', 'show'=>1, 'wiki' => 'dealTypeManagement'],
+//            ['name'=>'交易类型添加', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'deal-type-add', 'routePath'=>'finance/deal-type-add', 'show'=>0,],
+//            ['name'=>'交易类型修改', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'deal-type-edit', 'routePath'=>'finance/deal-type-edit', 'show'=>0,],
+//            ['name'=>'Historical bonus balance', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'history-bonus', 'routePath'=>'finance/history-bonus', 'show'=>1, 'wiki' => 'historicalBonusBalance'],// 历史奖金余额
+//            ['name'=>'历史奖金余额导出', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'history-bonus-export', 'routePath'=>'finance/history-bonus-export', 'show'=>0,],
             ['name'=>'Recharge management', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'recharge', 'routePath'=>'finance/recharge', 'show'=>1, 'wiki' => 'rechargeManagement'], // 充值管理
             ['name'=>'充值导出', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'recharge-export', 'routePath'=>'finance/recharge-export', 'show'=>0,],
             //['name'=>'充值管理-充值待审核', 'class'=>'', 'icon'=>'', 'controller'=>'finance', 'action'=>'recharge-0', 'routePath'=>'finance/recharge-0', 'show'=>0,],
@@ -378,10 +378,10 @@ return [
         'show'=>1,
         'wiki' => 'articleManagement',
         'child'=>[
-            ['name'=>'Category Management', 'class'=>'', 'icon'=>'', 'controller'=>'article', 'action'=>'category', 'routePath'=>'article/category', 'show'=>1, 'wiki' => 'categoryManagement'],//分类管理
-            ['name'=>'添加分类', 'class'=>'', 'icon'=>'', 'controller'=>'article', 'action'=>'category-add', 'routePath'=>'article/category-add', 'show'=>0,],
-            ['name'=>'删除分类', 'class'=>'', 'icon'=>'', 'controller'=>'article', 'action'=>'category-delete', 'routePath'=>'article/category-delete', 'show'=>0,],
-            ['name'=>'分类排序', 'class'=>'', 'icon'=>'', 'controller'=>'article', 'action'=>'category-sort', 'routePath'=>'article/category-sort', 'show'=>0,],
+//            ['name'=>'Category Management', 'class'=>'', 'icon'=>'', 'controller'=>'article', 'action'=>'category', 'routePath'=>'article/category', 'show'=>1, 'wiki' => 'categoryManagement'],//分类管理
+//            ['name'=>'添加分类', 'class'=>'', 'icon'=>'', 'controller'=>'article', 'action'=>'category-add', 'routePath'=>'article/category-add', 'show'=>0,],
+//            ['name'=>'删除分类', 'class'=>'', 'icon'=>'', 'controller'=>'article', 'action'=>'category-delete', 'routePath'=>'article/category-delete', 'show'=>0,],
+//            ['name'=>'分类排序', 'class'=>'', 'icon'=>'', 'controller'=>'article', 'action'=>'category-sort', 'routePath'=>'article/category-sort', 'show'=>0,],
             ['name'=>'Article Management', 'class'=>'', 'icon'=>'', 'controller'=>'article', 'action'=>'index', 'routePath'=>'article/index', 'show'=>1, 'wiki' => 'articleManagement'],//文章列表
             ['name'=>'添加文章', 'class'=>'', 'icon'=>'', 'controller'=>'article', 'action'=>'add', 'routePath'=>'article/add', 'show'=>0,],
             ['name'=>'编辑文章', 'class'=>'', 'icon'=>'', 'controller'=>'article', 'action'=>'edit', 'routePath'=>'article/edit', 'show'=>0,],
@@ -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,],
@@ -509,16 +510,16 @@ return [
 //            ['name'=>'OCR接口编辑', 'class'=>'', 'icon'=>'', 'controller'=>'config', 'action'=>'ocr-api-edit', 'routePath'=>'config/ocr-api-edit', 'show'=>0,],
 //            ['name'=>'短信接口编辑', 'class'=>'', 'icon'=>'', 'controller'=>'config', 'action'=>'ocr-api-edit', 'routePath'=>'config/ocr-api-edit', 'show'=>0,],
 //            ['name'=>'短信管理', 'class'=>'', 'icon'=>'', 'controller'=>'config', 'action'=>'sms', 'routePath'=>'config/sms', 'show'=>1,],
-            ['name'=>'积分配置', 'class'=>'', 'icon'=>'', 'controller'=>'config', 'action'=>'score', 'routePath'=>'config/score', 'show'=>1, 'wiki' => 'scoreConfig'],
+//            ['name'=>'积分配置', 'class'=>'', 'icon'=>'', 'controller'=>'config', 'action'=>'score', 'routePath'=>'config/score', 'show'=>1, 'wiki' => 'scoreConfig'],
             ['name'=>'转账配置', 'class'=>'', 'icon'=>'', 'controller'=>'config', 'action'=>'transfer', 'routePath'=>'config/transfer', 'show'=>1, 'wiki' => 'transferConfig'],
             ['name'=>'汇率配置', 'class'=>'', 'icon'=>'', 'controller'=>'config', 'action'=>'exchange-rate', 'routePath'=>'config/exchange-rate', 'show'=>1,  'wiki' => 'exchangeRateConfig'],
             ['name'=>'其他配置', 'class'=>'', 'icon'=>'', 'controller'=>'config', 'action'=>'other', 'routePath'=>'config/other', 'show'=>1, 'wiki' => 'otherConfig'],
             ['name'=>'会员级别配置', 'class'=>'', 'icon'=>'', 'controller'=>'config', 'action'=>'dec-level', 'routePath'=>'config/dec-level', 'show'=>1, 'wiki' => 'decLevelConfig'],
             ['name'=>'添加会员级别', 'class'=>'', 'icon'=>'', 'controller'=>'config', 'action'=>'dec-level-add', 'routePath'=>'config/dec-level-add', 'show'=>0,],
             ['name'=>'编辑会员级别', 'class'=>'', 'icon'=>'', 'controller'=>'config', 'action'=>'dec-level-edit', 'routePath'=>'config/dec-level-edit', 'show'=>0,],
-            ['name'=>'会员聘级配置', 'class'=>'', 'icon'=>'', 'controller'=>'config', 'action'=>'emp-level', 'routePath'=>'config/emp-level', 'show'=>1, 'wiki' => 'empLevelConfig'],
-            ['name'=>'添加会员聘级', 'class'=>'', 'icon'=>'', 'controller'=>'config', 'action'=>'emp-level-add', 'routePath'=>'config/emp-level-add', 'show'=>0,],
-            ['name'=>'编辑会员聘级', 'class'=>'', 'icon'=>'', 'controller'=>'config', 'action'=>'emp-level-edit', 'routePath'=>'config/emp-level-edit', 'show'=>0,],
+//            ['name'=>'会员聘级配置', 'class'=>'', 'icon'=>'', 'controller'=>'config', 'action'=>'emp-level', 'routePath'=>'config/emp-level', 'show'=>1, 'wiki' => 'empLevelConfig'],
+//            ['name'=>'添加会员聘级', 'class'=>'', 'icon'=>'', 'controller'=>'config', 'action'=>'emp-level-add', 'routePath'=>'config/emp-level-add', 'show'=>0,],
+//            ['name'=>'编辑会员聘级', 'class'=>'', 'icon'=>'', 'controller'=>'config', 'action'=>'emp-level-edit', 'routePath'=>'config/emp-level-edit', 'show'=>0,],
             ['name'=>'报单中心级别配置', 'class'=>'', 'icon'=>'', 'controller'=>'config', 'action'=>'dec-role', 'routePath'=>'config/dec-role', 'show'=>1, 'wiki' => 'decRoleConfig'],
             ['name'=>'编辑报单中心级别', 'class'=>'', 'icon'=>'', 'controller'=>'config', 'action'=>'dec-role-edit', 'routePath'=>'config/dec-role-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'];  // 旅游奖比例