Browse Source

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

kevin 1 year ago
parent
commit
cf01028d7c
1 changed files with 13 additions and 2 deletions
  1. 13 2
      frontendApi/modules/v1/controllers/BonusController.php

+ 13 - 2
frontendApi/modules/v1/controllers/BonusController.php

@@ -447,12 +447,23 @@ class BonusController extends BaseController {
                 'IFNULL(SUM(BONUS_WB), 0.00) AS BONUS_WB',
                 'IFNULL(SUM(BONUS_CAR), 0.00) AS BONUS_CAR',
                 'IFNULL(SUM(BONUS_PB), 0.00) AS BONUS_PB',
-                'IFNULL(SUM(BONUS_TOTAL), 0.00) AS BONUS_TOTAL'
             ])
             ->asArray()
             ->one();
 
-        return static::notice(['tableData' => [$calcBonus]]);
+        $data = [
+            ['name' => 'eliteBonus', 'bonus' => $calcBonus['BONUS_E'] ?? '0'],
+            ['name' => 'proEliteBonus', 'bonus' => $calcBonus['BONUS_PE'] ?? '0'],
+            ['name' => 'superEliteBonus', 'bonus' => $calcBonus['BONUS_SE'] ?? '0'],
+            ['name' => 'stockistBonus', 'bonus' => $calcBonus['BONUS_ST'] ?? '0'],
+            ['name' => 'leaderShipBonus', 'bonus' => $calcBonus['BONUS_LB'] ?? '0'],
+            ['name' => 'welcomeBonus', 'bonus' => $calcBonus['BONUS_WB'] ?? '0'],
+            ['name' => 'carBonus', 'bonus' => $calcBonus['BONUS_CAR'] ?? '0'],
+            ['name' => 'userPerformanceBonus', 'bonus' => $calcBonus['BONUS_PB'] ?? '0'],
+        ];
+
+
+        return static::notice(['tableData' => $data]);
     }
 
     /**