Jelajahi Sumber

Merge branch 'master' into feature/dev-frontend-ui

kevin_zhangl 3 tahun lalu
induk
melakukan
43d5ef493b

+ 1 - 0
common/config/main.php

@@ -29,6 +29,7 @@ return [
 //        'dbShop' => array_merge(['class' => 'yii\db\Connection', 'schemaMap' => ['oci' => 'common\helpers\Schema']], $mainConfig['dbShop']),
         'dbLog' => array_merge(['class' => 'yii\mongodb\Connection',], $mainConfig['dbLog']),
         'dbCalc' => array_merge(['class' => 'yii\db\Connection'], $mainConfig['dbCalc']),
+        'dbCalcServer' => array_merge(['class' => 'yii\db\Connection'], $mainConfig['dbCalcServer']),
 //        'dbShopCalc' => array_merge(['class' => 'yii\db\Connection', 'schemaMap' => ['oci' => 'common\helpers\Schema'],], $mainConfig['dbShopCalc']),
         'dbNetPoint' => array_merge(['class' => 'yii\db\Connection'], $mainConfig['dbNetPoint']),
         // 'cache' => [

+ 3 - 3
common/helpers/bonus/Calc/BaseBusiness.php

@@ -11,9 +11,9 @@ class BaseBusiness
 
     protected $_periodNum = 0;
 
-    protected $_calc_db_name = 'dbCalc';
+    protected $_calc_db_name = 'dbCalcServer';
 
-    const CALC_DB_NAME = 'dbCalc';
+    const CALC_DB_NAME = 'dbCalcServer';
 
     protected $_limit = 10000;
 
@@ -77,4 +77,4 @@ class BaseBusiness
         $calcMonth2 = date('Ym', strtotime('+' . ($this->_calcMonth - 2) . ' month', $startTime));
         return [$calcMonth1, $calcMonth2];
     }
-}
+}

+ 2 - 2
common/helpers/bonus/Calc/BasePerfBusiness.php

@@ -10,7 +10,7 @@ class BasePerfBusiness extends BaseBusiness
 {
     protected $_periodNum = 0;
 
-    protected $_calc_db_name = 'dbCalc';
+    protected $_calc_db_name = 'dbCalcServer';
 
     protected $_limit = 10000;
 
@@ -30,4 +30,4 @@ class BasePerfBusiness extends BaseBusiness
             Period::updateAll(['IS_PERFING' => 0, 'IS_PERFED' => Period::PERF_FAIL, 'PERFED_AT' => 0], 'PERIOD_NUM=:PERIOD_NUM', [':PERIOD_NUM' => $this->_periodNum]);
         }
     }
-}
+}

+ 6 - 7
common/helpers/bonus/Calc/CalcConsole.php

@@ -8,7 +8,7 @@ use common\models\Period;
 
 class CalcConsole extends BaseBusiness
 {
-    const  CALC_DB_NAME = 'dbCalc';
+    const  CALC_DB_NAME = 'dbCalcServer';
 
     public static function listenCalcPeriod()
     {
@@ -114,20 +114,19 @@ if (empty($period)){
         }
         if (2 == $period['IS_PREPARE'] && 1 == $period['IS_PERFED']) {
             //拉取期业绩
-            CalcRecord::record($period['PERIOD_NUM'], '第' . $period['PERIOD_NUM'] . '期的业绩数据已生成');
-            CalcRecord::record($period['PERIOD_NUM'], '开始获取第' . $period['PERIOD_NUM'] . '期的期业绩数据');
+            CalcRecord::record($period['PERIOD_NUM'], '第' . $period['PERIOD_NUM'] . '期的预计算业绩数据已生成');
+            CalcRecord::record($period['PERIOD_NUM'], '开始获取第' . $period['PERIOD_NUM'] . '期的预计算期业绩数据');
 
             Period::updatePeriodIsProcessing($period['PERIOD_NUM'], Period::IS_PROCESSING);
             $res = (new PullPerfDataFromCalc($period['PERIOD_NUM']))->start();
             if (200 == $res['code']) {
                 Period::updatePeriodIsProcessing($period['PERIOD_NUM'], Period::NOT_PROCESSING);
-                CalcRecord::record($period['PERIOD_NUM'], '第' . $period['PERIOD_NUM'] . '期的期业绩数据已获取55');
-                \Yii::$app->$db->createCommand()->update('AR_PERIOD', ['IS_PERFED' => 3], 'PERIOD_NUM=:PERIOD_NUM', ['PERIOD_NUM' => $period['PERIOD_NUM']])->execute();
+                CalcRecord::record($period['PERIOD_NUM'], '第' . $period['PERIOD_NUM'] . '期的预计算期业绩数据已获取');
                 return $res;
             } else {
                 //结束计算状态
                 Period::updatePeriodIsProcessing($period['PERIOD_NUM'], Period::NOT_PROCESSING);
-                CalcRecord::record($period['PERIOD_NUM'], '第' . $period['PERIOD_NUM'] . '期的期业绩数据获取失败,原因:' . $res['msg']);
+                CalcRecord::record($period['PERIOD_NUM'], '第' . $period['PERIOD_NUM'] . '期的预计算期业绩数据获取失败,原因:' . $res['msg']);
                 return $res;
             }
         }
@@ -163,4 +162,4 @@ if (empty($period)){
         }
         return true;
     }
-}
+}

+ 3 - 2
common/helpers/bonus/Calc/PushBaseDataToCalc.php

@@ -24,7 +24,7 @@ class PushBaseDataToCalc extends BaseBusiness
 {
     const BASE_INFO_METHODS = [
         //--- 用户表
-        'user'             => ['separately' => true, 'table' => 'AR_USER', 'field' => [
+        'user'             => ['table' => 'AR_USER', 'field' => [
             'ID',
             'USER_NAME',
             'REAL_NAME',
@@ -37,6 +37,7 @@ class PushBaseDataToCalc extends BaseBusiness
             'DEC_ID',
             'DEC_ROLE_ID',
             'LAST_DEC_LV',
+            'LAST_EMP_LV',
             'IS_STUDIO',
             'LAST_CROWN_LV',
             'DELETED',
@@ -655,4 +656,4 @@ class PushBaseDataToCalc extends BaseBusiness
         $data = null;
         return true;
     }
-}
+}

+ 6 - 6
frontendEle/src/views/bonus/teams.vue

@@ -31,17 +31,17 @@
         </el-table-column>
         <el-table-column
           prop="user_perf"
-          label="Personal Performance"
+          label="Personal BV"
           ><!-- 个人业绩 -->
         </el-table-column>
          <el-table-column
           prop="team_perf"
-          label="Cumulative Performance"
+          label="PGS"
           ><!-- 累计业绩 -->
         </el-table-column>
          <el-table-column
           prop="total_perf"
-          label="Total Performance"
+          label="Total BV"
           ><!-- 合计 -->
         </el-table-column>
       </el-table-column>
@@ -80,17 +80,17 @@
         </el-table-column>
         <el-table-column
           prop="user_perf"
-          label="Personal Performance"
+          label="Personal BV"
           ><!-- 个人业绩 -->
         </el-table-column>
          <el-table-column
           prop="team_perf"
-          label="Cumulative Performance"
+          label="PGS"
           ><!-- 累计业绩 -->
         </el-table-column>
          <el-table-column
           prop="total_perf"
-          label="Total Performance"
+          label="Total BV"
           ><!-- 合计 -->
         </el-table-column>
       </el-table-column>