Przeglądaj źródła

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

kevin 1 rok temu
rodzic
commit
89cb574175
1 zmienionych plików z 22 dodań i 29 usunięć
  1. 22 29
      frontendApi/modules/v1/controllers/BonusController.php

+ 22 - 29
frontendApi/modules/v1/controllers/BonusController.php

@@ -396,26 +396,25 @@ class BonusController extends BaseController {
      * @return mixed
      * @throws \yii\web\HttpException
      */
-    public function actionOther(){
+    public function actionOther() {
         //获取可以查看几期奖金
         $showBonusPeriodNum = Cache::getSystemConfig()['showBonusPeriodNum']['VALUE'];
-        $calcBonus = CalcBonus::find()->where('USER_ID=:USER_ID AND IS_SENT=1', [':USER_ID' => \Yii::$app->user->id])
-        ->select('PERIOD_NUM,ORI_BONUS_QY,ORI_BONUS_YC,ORI_BONUS_VIP,ORI_BONUS_STANDARD,ORI_BONUS_BD,ORI_BONUS_TG,
-        ORI_BONUS_XF,BONUS_TOTAL,MANAGE_TAX,BONUS_REAL,BONUS_INCOME,ORI_BONUS_YJ,ORI_BONUS_GX,ORI_BONUS_GL,RECONSUME_POINTS,
-        LAST_DEC_LV,LAST_EMP_LV,EXCHANGE_POINTS,ORI_BONUS_BS,ORI_BONUS_BS_MNT,ORI_BONUS_BS_ABBR,ORI_BONUS_QUARTER,BONUS_TOURISM,BONUS_GARAGE')
-        ->limit($showBonusPeriodNum)
-        ->orderBy('PERIOD_NUM DESC')
-        ->asArray()
-        ->all();
         $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')
+            ->limit($showBonusPeriodNum)
+            ->orderBy('PERIOD_NUM DESC')
+            ->asArray()
+            ->all();
+
         //增加明细开关控制(0 只显示总奖金 1 全部显示)
         $flowBonusSwitch = Cache::getSystemConfig()['flowBonusSwitch']['VALUE'];
 
         $bonusSwitch = [
-            'welcomeBonusSwitch' => intval($sysConfig['openTG']['VALUE']),
-            'teamBonusSwitch' => intval($sysConfig['openQY']['VALUE']),
-            'stockistCommissionSwitch' => intval($sysConfig['openFW']['VALUE']),
+            'welcomeBonusSwitch' => 0,
+            'teamBonusSwitch' => 0,
+            'stockistCommissionSwitch' => 0,
         ];
 
         $result = [];
@@ -424,24 +423,18 @@ class BonusController extends BaseController {
                 $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'])];
 
-                // 销售奖金,就是原来的推广奖金
-                if ($sysConfig['openTG']['VALUE']) {
-                    $result[$key]['BONUS_TG'] = ['name' => '销售奖金', 'value' => Tool::formatPrice($data['ORI_BONUS_TG'])];
-                }
-                // 业绩奖金,就是原来的团队奖  并将业绩奖金改成绩效奖金
-                if ($sysConfig['openQY']['VALUE']) {
-                    $result[$key]['ORI_BONUS_QY'] = ['name' => '业绩奖金', 'value' => Tool::formatPrice($data['ORI_BONUS_QY'])];
-                }
-                if ($sysConfig['openFW']['VALUE']) {
-                    $result[$key]['BONUS_BD'] = ['name' => '服务奖金', 'value' => Tool::formatPrice($data['ORI_BONUS_BD'])];
-                }
-                $result[$key]['ORI_BONUS_BS'] = ['name' => '管理奖金', 'value' => Tool::formatPrice($data['ORI_BONUS_BS'])];
-                $result[$key]['ORI_BONUS_BS_MNT'] = ['name' => '管理奖金', 'value' => Tool::formatPrice($data['ORI_BONUS_BS_MNT'])];
-                $result[$key]['ORI_BONUS_BS_ABBR'] = ['name' => '绩效奖金', 'value' => Tool::formatPrice($data['ORI_BONUS_BS_ABBR'])];
-                $result[$key]['ORI_BONUS_QUARTER'] = ['name' => '季度奖金', 'value' => Tool::formatPrice($data['ORI_BONUS_QUARTER'] ?? 0)];
-                $result[$key]['BONUS_TOTAL'] = ['name' => '合计', 'value' => Tool::formatPrice($data['BONUS_TOTAL'])];
-                $result[$key]['BONUS_REAL'] = ['name' => '实发奖金', 'value' => Tool::formatPrice($data['BONUS_REAL'])];
+                $result[$key]['BONUS_PB'] = ['name' => '绩效奖金', 'value' => Tool::formatPrice($data['BONUS_PB'])];
             } else {
                 $result[$key]['BONUS_TOTAL'] = ['name' => '总奖金', 'value' => Tool::formatPrice($data['BONUS_TOTAL'])];
             }