فهرست منبع

feat: UN-71: 会员-奖金列表调整

kevin 1 سال پیش
والد
کامیت
408826be42
1فایلهای تغییر یافته به همراه17 افزوده شده و 48 حذف شده
  1. 17 48
      frontendApi/modules/v1/controllers/BonusController.php

+ 17 - 48
frontendApi/modules/v1/controllers/BonusController.php

@@ -399,7 +399,6 @@ class BonusController extends BaseController {
     public function actionOther() {
         //获取可以查看几期奖金
         $showBonusPeriodNum = Cache::getSystemConfig()['showBonusPeriodNum']['VALUE'];
-        $sysConfig = Cache::getSystemConfig();
 
         $calcBonus = CalcBonus::find()->where('USER_ID=:USER_ID AND IS_SENT=1', [':USER_ID' => \Yii::$app->user->id])
             ->select('PERIOD_NUM,CALC_MONTH,LAST_DEC_LV,LAST_EMP_LV,LAST_ELITE_LV,BONUS_TOTAL,BONUS_E,BONUS_PE,BONUS_SE,BONUS_LB,BONUS_ST,BONUS_WB,BONUS_CAR,BONUS_PB')
@@ -408,39 +407,27 @@ class BonusController extends BaseController {
             ->asArray()
             ->all();
 
-        //增加明细开关控制(0 只显示总奖金 1 全部显示)
-        $flowBonusSwitch = Cache::getSystemConfig()['flowBonusSwitch']['VALUE'];
-
-        $bonusSwitch = [
-            'welcomeBonusSwitch' => 0,
-            'teamBonusSwitch' => 0,
-            'stockistCommissionSwitch' => 0,
-        ];
 
         $result = [];
         foreach ($calcBonus as $key => $data) {
-            if ($flowBonusSwitch) {
-                $result[$key]['PERIOD_NUM'] = ['name' => '期数', 'value' => $data['PERIOD_NUM']];
-                $result[$key]['LAST_DEC_NAME'] = ['name' => '级别', 'value' => Cache::getDecLevelConfig()[$data['LAST_DEC_LV']]['LEVEL_NAME']];
-                $result[$key]['LAST_EMP_NAME'] = ['name' => '聘级', 'value' => Cache::getEmpLevelConfig()[$data['LAST_EMP_LV']]['LEVEL_NAME']];
-                $result[$key]['LAST_ELITE_NAME'] = ['name' => 'Elite级别', 'value' => Cache::getEliteLevelConfig()[$data['LAST_ELITE_LV']]['LEVEL_NAME']];
-
-                $result[$key]['BONUS_E'] = ['name' => 'Elite奖金', 'value' => Tool::formatPrice($data['BONUS_E'])];
-                $result[$key]['BONUS_PE'] = ['name' => 'SuperElite奖金', 'value' => Tool::formatPrice($data['BONUS_PE'])];
-                $result[$key]['BONUS_SE'] = ['name' => 'ProElite奖金', 'value' => Tool::formatPrice($data['BONUS_SE'])];
-                $result[$key]['BONUS_LB'] = ['name' => 'LeaderShip奖金', 'value' => Tool::formatPrice($data['BONUS_LB'])];
-                $result[$key]['BONUS_ST'] = ['name' => '店铺奖', 'value' => Tool::formatPrice($data['BONUS_ST'])];
-                $result[$key]['BONUS_WB'] = ['name' => '迎新奖', 'value' => Tool::formatPrice($data['BONUS_WB'])];
-                $result[$key]['BONUS_CAR'] = ['name' => '车奖', 'value' => Tool::formatPrice($data['BONUS_CAR'])];
-                $result[$key]['BONUS_TOTAL'] = ['name' => '总奖金', 'value' => Tool::formatPrice($data['BONUS_TOTAL'])];
-
-                $result[$key]['BONUS_PB'] = ['name' => '绩效奖金', 'value' => Tool::formatPrice($data['BONUS_PB'])];
-            } else {
-                $result[$key]['BONUS_TOTAL'] = ['name' => '总奖金', 'value' => Tool::formatPrice($data['BONUS_TOTAL'])];
-            }
+            $result[$key]['PERIOD_NUM'] = ['name' => '期数', 'value' => $data['PERIOD_NUM']];
+            $result[$key]['LAST_DEC_NAME'] = ['name' => '级别', 'value' => Cache::getDecLevelConfig()[$data['LAST_DEC_LV']]['LEVEL_NAME']];
+            $result[$key]['LAST_EMP_NAME'] = ['name' => '聘级', 'value' => Cache::getEmpLevelConfig()[$data['LAST_EMP_LV']]['LEVEL_NAME']];
+            $result[$key]['LAST_ELITE_NAME'] = ['name' => 'Elite级别', 'value' => Cache::getEliteLevelConfig()[$data['LAST_ELITE_LV']]['LEVEL_NAME']];
+
+            $result[$key]['BONUS_E'] = ['name' => 'Elite奖金', 'value' => Tool::formatPrice($data['BONUS_E'])];
+            $result[$key]['BONUS_PE'] = ['name' => 'SuperElite奖金', 'value' => Tool::formatPrice($data['BONUS_PE'])];
+            $result[$key]['BONUS_SE'] = ['name' => 'ProElite奖金', 'value' => Tool::formatPrice($data['BONUS_SE'])];
+            $result[$key]['BONUS_LB'] = ['name' => 'LeaderShip奖金', 'value' => Tool::formatPrice($data['BONUS_LB'])];
+            $result[$key]['BONUS_ST'] = ['name' => '店铺奖', 'value' => Tool::formatPrice($data['BONUS_ST'])];
+            $result[$key]['BONUS_WB'] = ['name' => '迎新奖', 'value' => Tool::formatPrice($data['BONUS_WB'])];
+            $result[$key]['BONUS_CAR'] = ['name' => '车奖', 'value' => Tool::formatPrice($data['BONUS_CAR'])];
+            $result[$key]['BONUS_TOTAL'] = ['name' => '总奖金', 'value' => Tool::formatPrice($data['BONUS_TOTAL'])];
+
+            $result[$key]['BONUS_PB'] = ['name' => '绩效奖金', 'value' => Tool::formatPrice($data['BONUS_PB'])];
         }
 
-        return static::notice(['tableData' => $result, 'tableKey' => '', 'bonusSwitch' => $bonusSwitch]);
+        return static::notice(['tableData' => $result, 'tableKey' => '']);
     }
 
     /**
@@ -465,25 +452,7 @@ class BonusController extends BaseController {
             ->asArray()
             ->one();
 
-        // 增加明细开关控制(0 只显示总奖金 1 全部显示)
-        $flowBonusSwitch = Cache::getSystemConfig()['flowBonusSwitch']['VALUE'];
-
-//        if ($calcBonus) {
-//            if ($flowBonusSwitch) {
-//                $flowBonusSwitch['BONUS_E'] = ['name' => 'Elite奖金', 'value' => Tool::formatPrice($calcBonus['BONUS_E'])];
-//                $flowBonusSwitch['BONUS_PE'] = ['name' => 'SuperElite奖金', 'value' => Tool::formatPrice($calcBonus['BONUS_PE'])];
-//                $flowBonusSwitch['BONUS_SE'] = ['name' => 'ProElite奖金', 'value' => Tool::formatPrice($calcBonus['BONUS_SE'])];
-//                $flowBonusSwitch['BONUS_LB'] = ['name' => 'LeaderShip奖金', 'value' => Tool::formatPrice($calcBonus['BONUS_LB'])];
-//                $flowBonusSwitch['BONUS_ST'] = ['name' => '店铺奖', 'value' => Tool::formatPrice($calcBonus['BONUS_ST'])];
-//                $flowBonusSwitch['BONUS_WB'] = ['name' => '迎新奖', 'value' => Tool::formatPrice($calcBonus['BONUS_WB'])];
-//                $flowBonusSwitch['BONUS_CAR'] = ['name' => '车奖', 'value' => Tool::formatPrice($calcBonus['BONUS_CAR'])];
-//                $flowBonusSwitch['BONUS_PB'] = ['name' => '绩效奖金', 'value' => Tool::formatPrice($calcBonus['BONUS_PB'])];
-//            }
-//
-//            $calcBonus['BONUS_TOTAL'] = ['name' => '总奖金', 'value' => Tool::formatPrice($calcBonus['BONUS_TOTAL'])];
-//        }
-
-        return static::notice(['tableData' => [$calcBonus], 'bonusSwitch' => $flowBonusSwitch]);
+        return static::notice(['tableData' => [$calcBonus]]);
     }
 
     /**