root 3 лет назад
Родитель
Сommit
6cd7b594a4

+ 2 - 2
backendApi/modules/v1/controllers/ConfigController.php

@@ -115,11 +115,11 @@ class ConfigController extends BaseController {
         // 获取会员报单级别的相关参数
         $decLevel = DeclarationLevel::find()->orderBy('SORT ASC')->asArray()->all();
         // 获取会员聘级相关参数
-        $empLevel = EmployLevel::getAllDataWithNumIndex();
+        // $empLevel = EmployLevel::getAllDataWithNumIndex();
         $result = [
             'config' => $configs,
             'decLevel' => $decLevel,
-            'empLevel' => $empLevel,
+            // 'empLevel' => $empLevel,
         ];
         return static::notice($result);
     }

+ 2 - 39
backendEle/src/views/config/bonus-opt.vue

@@ -112,44 +112,7 @@
         </div>
       </div>
     </div>
-    <div class="panel" v-if="permission.hasPermission(`config/bonus-dec-level`)">
-      <div class="panel-heading">
-        管理奖
-      </div>
-      <div class="panel-wrapper">
-        <div class="panel-body">
-          <el-table :data="decLevelTableData" stripe style="width: 100%;">
-            <el-table-column prop="LEVEL_NAME" label="级别名称"></el-table-column>
-            <el-table-column label="奇数代数(推广1人)">
-              <template slot-scope="scope">
-                <el-input v-model="scope.row.GL_ODD_DEEP_ONE" min="0" max="100">
-                  <template slot="append">代</template>
-                </el-input>
-              </template>
-            </el-table-column>
-            <el-table-column label="奇数代数(推广2人)">
-              <template slot-scope="scope">
-                <el-input v-model="scope.row.GL_ODD_DEEP_TWO" min="0" max="100">
-                  <template slot="append">代</template>
-                </el-input>
-              </template>
-            </el-table-column>
-            <el-table-column label="奇数代数(推广3人)">
-              <template slot-scope="scope">
-                <el-input v-model="scope.row.GL_ODD_DEEP_THREE" min="0" max="100">
-                  <template slot="append">代</template>
-                </el-input>
-              </template>
-            </el-table-column>
-          </el-table>
-        </div>
-        <div class="panel-footer">
-          <el-button type="primary" @click="onGLSubmit" :loading="glSubmitButtonStat" style="float: right;">保存
-          </el-button>
-        </div>
-      </div>
-    </div>
-    <div class="panel" v-if="permission.hasPermission(`config/bonus-emp-level`)">
+    <!-- <div class="panel" v-if="permission.hasPermission(`config/bonus-emp-level`)">
       <div class="panel-heading">
         荣衔奖和积分配置
       </div>
@@ -185,7 +148,7 @@
           </el-button>
         </div>
       </div>
-    </div>
+    </div> -->
   </div>
 </template>
 

+ 3 - 114
common/helpers/bonus/BonusCalc.php

@@ -198,33 +198,7 @@ class BonusCalc extends BaseObject {
             echo('计算推广奖'.($this->_sysConfig['openTG']['VALUE']?'完成':'关闭').',耗时:' . round($t5 - $t4, 3) . ',内存使用:' . (round(memory_get_usage() / 1024 / 1024, 3)) . 'MB' . PHP_EOL);
             $this->_updatePercent(20);
 
-            if($this->_sysConfig['openXF']['VALUE']) {
-                if( $this->_sysConfig['consumeRecPercent']['VALUE'] > 0 ) {
-                    $this->calcBonusXFToRec();
-                }
-                if( $this->_sysConfig['consumeSelfPercent']['VALUE'] > 0 ) {
-                    $this->calcBonusXFToSelf();
-                }
-            }
-            $t6 = microtime(true);
-            echo('计算消费奖'.($this->_sysConfig['openXF']['VALUE']?'完成':'关闭').',耗时:' . round($t6 - $t5, 3) . ',内存使用:' . (round(memory_get_usage() / 1024 / 1024, 3)) . 'MB' . PHP_EOL);
-            $this->_updatePercent(25);
-
-            if($this->_sysConfig['openYJ']['VALUE']) {
-                $this->calcBonusBdYJ();
-            }
-            $t7 = microtime(true);
-            echo('计算报单业绩奖'.($this->_sysConfig['openYJ']['VALUE']?'完成':'关闭').',耗时:' . round($t7 - $t6, 3) . ',内存使用:' . (round(memory_get_usage() / 1024 / 1024, 3)) . 'MB' . PHP_EOL);
-            $this->_updatePercent(30);
-
-            if($this->_sysConfig['fxOpenYJ']['VALUE']) {
-                $this->calcBonusFxYJ();
-            }
             $t8 = microtime(true);
-            echo('计算复消业绩奖'.($this->_sysConfig['fxOpenYJ']['VALUE']?'完成':'关闭').',耗时:' . round($t8 - $t7, 3) . ',内存使用:' . (round(memory_get_usage() / 1024 / 1024, 3)) . 'MB' . PHP_EOL);
-            $this->_updatePercent(35);
-
-
             if($this->_sysConfig['openQY']['VALUE']) {
                 $this->calcBonusQY();
                 $this->calcBonusBdQY();
@@ -249,19 +223,6 @@ class BonusCalc extends BaseObject {
             echo('计算报单管理奖'.($this->_sysConfig['openGL']['VALUE']?'完成':'关闭').',耗时:' . round($t13 - $t11, 3) . ',内存使用:' . (round(memory_get_usage() / 1024 / 1024, 3)) . 'MB' . PHP_EOL);
             $this->_updatePercent(50);
 
-//            if($this->_sysConfig['fxOpenGL']['VALUE']) {
-//                $this->calcBonusFxGL();
-//            }
-//            $t14 = microtime(true);
-//            echo('计算复消管理奖'.($this->_sysConfig['fxOpenGL']['VALUE']?'完成':'关闭').',耗时:' . round($t14 - $t13, 3) . ',内存使用:' . (round(memory_get_usage() / 1024 / 1024, 3)) . 'MB' . PHP_EOL);
-//            $this->_updatePercent(70);
-          
-
-            // if($this->_sysConfig['openYC']['VALUE']) {
-            //     $this->calcBonusYCStepOne();
-            //     $this->calcBonusYCStepTwo();
-            // }
-
             // 计算店服务奖 月奖
             if($this->_sysConfig['openStore']['VALUE']) {
                 if ($this->_sysConfig['openStoreReduce']['VALUE']) {
@@ -276,20 +237,7 @@ class BonusCalc extends BaseObject {
             echo('计算店服务奖金'.($this->_sysConfig['openStore']['VALUE']?'完成':'关闭').',耗时:' . round($t16 - $t13, 3) . ',内存使用:' . (round(memory_get_usage() / 1024 / 1024, 3)) . 'MB' . PHP_EOL);
             $this->_updatePercent(55);
 
-            if($this->_sysConfig['openVIP']['VALUE']) {
-                $this->calcBonusVIP();
-            }
             $t17 = microtime(true);
-            echo('计算VIP奖'.($this->_sysConfig['openVIP']['VALUE']?'完成':'关闭').',耗时:' . round($t17 - $t16, 3) . ',内存使用:' . (round(memory_get_usage() / 1024 / 1024, 3)) . 'MB' . PHP_EOL);
-            $this->_updatePercent(60);
-
-            if($this->_sysConfig['openJXS']['VALUE']) {
-                $this->calcBonusStandard();
-            }
-            $t18 = microtime(true);
-            echo('计算达标奖'.($this->_sysConfig['openJXS']['VALUE']?'完成':'关闭').',耗时:' . round($t18 - $t17, 3) . ',内存使用:' . (round(memory_get_usage() / 1024 / 1024, 3)) . 'MB' . PHP_EOL);
-            $this->_updatePercent(65);
-
             // 蓝星奖入库,实际上是插入有奖金会员数据缓存中.
             // 调用存储过程,计算蓝星管理奖金
             $this->calcBsProcedure();
@@ -297,8 +245,8 @@ class BonusCalc extends BaseObject {
             $this->calcBonusBsGL();
             $this->calcBonusBsGLCF();
             $this->calcBonusBsYJCF();
-            $t18temp = microtime(true);
-            echo('计算蓝星管理奖'.($this->_sysConfig['openGL']['VALUE']?'完成':'关闭').',耗时:' . round($t18temp - $t18, 3) . ',内存使用:' . (round(memory_get_usage() / 1024 / 1024, 3)) . 'MB' . PHP_EOL);
+            $t18 = microtime(true);
+            echo('计算蓝星管理奖'.($this->_sysConfig['openGL']['VALUE']?'完成':'关闭').',耗时:' . round($t18 - $t17, 3) . ',内存使用:' . (round(memory_get_usage() / 1024 / 1024, 3)) . 'MB' . PHP_EOL);
             $this->_updatePercent(65);
 
             //把奖金会员写入缓存
@@ -311,7 +259,7 @@ class BonusCalc extends BaseObject {
             $this->loopBonusUsers();
             // 入库完成,将各个奖金计算流水会员聘级,更新成蓝星奖当时计算的聘级
             $this->loopCalcBlueEmpLv();
-            $this->_updatePercent(75);
+            $this->_updatePercent(85);
             unset($calcWrite);
             $t20 = microtime(true);
             echo('奖金写库操作完成,耗时:' . round($t20 - $t19, 3) . ',内存使用:' . (round(memory_get_usage() / 1024 / 1024, 3)) . 'MB' . PHP_EOL);
@@ -320,21 +268,7 @@ class BonusCalc extends BaseObject {
             $this->loopMonthBonusUserToDb();
             $t21 = microtime(true);
             echo('奖金会员入库完成,耗时:' . round($t21 - $t20, 3) . ',内存使用:' . (round(memory_get_usage() / 1024 / 1024, 3)) . 'MB' . PHP_EOL);
-            $this->_updatePercent(80);
-
-            // 计算基础积分,不可以奖金入库之前计算这样可能会丢掉只有本期的奖金的会员
-            $this->calcBaseScore();
-            $this->_updatePercent(90);
-            $t22 = microtime(true);
-            echo('计算基础积分,耗时:' . round($t22 - $t21, 3) . ',内存使用:' . (round(memory_get_usage() / 1024 / 1024, 3)) . 'MB' . PHP_EOL);
-
-            //积分入库
-            $this->loopWriteScore();
             $this->_updatePercent(100);
-            $t23 = microtime(true);
-            echo('积分写库操作完成,耗时:' . round($t23 - $t22, 3) . ',内存使用:' . (round(memory_get_usage() / 1024 / 1024, 3)) . 'MB' . PHP_EOL);
-
-            //@todo 计算房产奖
 
             $t30 = microtime(true);
             echo('结算全部完成,共耗时:' . round($t30 - $t1, 3) . ',内存使用:' . (round(memory_get_usage() / 1024 / 1024, 3)) . 'MB' . PHP_EOL);
@@ -509,11 +443,6 @@ class BonusCalc extends BaseObject {
                         'decPercentConfig' => $this->_sysConfig['decPercent']['VALUE'],
                         'recNum' => $bonusUserInfo['REC_NUM'],
                         'decAmount' => $bonusUserInfo['ZC_AMOUNT'],
-                        'bonusTotalLimit' => [
-                            $this->_sysConfig['bonusTotalZeroLimit']['VALUE'],
-                            $this->_sysConfig['bonusTotalOneLimit']['VALUE'],
-                            $this->_sysConfig['bonusTotalTwoLimit']['VALUE'],
-                        ],
                     ]),
                 ];
 
@@ -597,11 +526,6 @@ class BonusCalc extends BaseObject {
                         'recNum' => $userBaseInfo['REC_NUM'],
                         'decAmount' => $userBaseInfo['ZC_AMOUNT'],
                         'decLevel' => $userBaseInfo['DEC_LV'],
-                        'bonusTotalLimit' => [
-                            $this->_sysConfig['bonusTotalZeroLimit']['VALUE'],
-                            $this->_sysConfig['bonusTotalOneLimit']['VALUE'],
-                            $this->_sysConfig['bonusTotalTwoLimit']['VALUE'],
-                        ],
                     ]),
                 ];
 
@@ -685,11 +609,6 @@ class BonusCalc extends BaseObject {
                         'recNum' => $userBaseInfo['REC_NUM'],
                         'decAmount' => $userBaseInfo['ZC_AMOUNT'],
                         'decLevel' => $userBaseInfo['DEC_LV'],
-                        'bonusTotalLimit' => [
-                            $this->_sysConfig['bonusTotalZeroLimit']['VALUE'],
-                            $this->_sysConfig['bonusTotalOneLimit']['VALUE'],
-                            $this->_sysConfig['bonusTotalTwoLimit']['VALUE'],
-                        ],
                     ]),
                 ];
 
@@ -773,11 +692,6 @@ class BonusCalc extends BaseObject {
                         'recNum' => $userBaseInfo['REC_NUM'],
                         'decAmount' => $userBaseInfo['ZC_AMOUNT'],
                         'decLevel' => $userBaseInfo['DEC_LV'],
-                        'bonusTotalLimit' => [
-                            $this->_sysConfig['bonusTotalZeroLimit']['VALUE'],
-                            $this->_sysConfig['bonusTotalOneLimit']['VALUE'],
-                            $this->_sysConfig['bonusTotalTwoLimit']['VALUE'],
-                        ],
                     ]),
                 ];
 
@@ -1189,11 +1103,6 @@ class BonusCalc extends BaseObject {
                             'recNum' => $bonusUserBaseInfo['REC_NUM'],
                             'decAmount' => $bonusUserBaseInfo['ZC_AMOUNT'],
                             'decLevel' => $bonusUserBaseInfo['DEC_LV'],
-                            'bonusTotalLimit' => [
-                                $this->_sysConfig['bonusTotalZeroLimit']['VALUE'],
-                                $this->_sysConfig['bonusTotalOneLimit']['VALUE'],
-                                $this->_sysConfig['bonusTotalTwoLimit']['VALUE'],
-                            ],
                         ]),
                     ];
 
@@ -1307,11 +1216,6 @@ class BonusCalc extends BaseObject {
                             'recNum' => $bonusUserBaseInfo['REC_NUM'],
                             'decAmount' => $bonusUserBaseInfo['ZC_AMOUNT'],
                             'decLevel' => $bonusUserBaseInfo['DEC_LV'],
-                            'bonusTotalLimit' => [
-                                $this->_sysConfig['bonusTotalZeroLimit']['VALUE'],
-                                $this->_sysConfig['bonusTotalOneLimit']['VALUE'],
-                                $this->_sysConfig['bonusTotalTwoLimit']['VALUE'],
-                            ],
                         ]),
                     ];
 
@@ -1768,11 +1672,6 @@ class BonusCalc extends BaseObject {
                             'incomeBonus' => $incomeBonus,
                             'recNum' => $userBaseInfo['REC_NUM'],
                             'decAmount' => $userBaseInfo['ZC_AMOUNT'],
-                            'bonusTotalLimit' => [
-                                $this->_sysConfig['bonusTotalZeroLimit']['VALUE'],
-                                $this->_sysConfig['bonusTotalOneLimit']['VALUE'],
-                                $this->_sysConfig['bonusTotalTwoLimit']['VALUE'],
-                            ],
                         ]),
                     ];
 
@@ -2073,11 +1972,6 @@ class BonusCalc extends BaseObject {
                             'decAmount' => $bonusUserBaseInfo['ZC_AMOUNT'],
                             'fromUserId' => $userId,
                             'decLevel' => $bonusUserBaseInfo['DEC_LV'],
-                            'bonusTotalLimit' => [
-                                $this->_sysConfig['bonusTotalZeroLimit']['VALUE'],
-                                $this->_sysConfig['bonusTotalOneLimit']['VALUE'],
-                                $this->_sysConfig['bonusTotalTwoLimit']['VALUE'],
-                            ],
                         ]),
                     ];
 
@@ -2208,11 +2102,6 @@ class BonusCalc extends BaseObject {
                             'decAmount' => $bonusUserBaseInfo['ZC_AMOUNT'],
                             'fromUserId' => $userId,
                             'decLevel' => $bonusUserBaseInfo['DEC_LV'],
-                            'bonusTotalLimit' => [
-                                $this->_sysConfig['bonusTotalZeroLimit']['VALUE'],
-                                $this->_sysConfig['bonusTotalOneLimit']['VALUE'],
-                                $this->_sysConfig['bonusTotalTwoLimit']['VALUE'],
-                            ],
                         ]),
                     ];
 

+ 2 - 18
common/helpers/bonus/PerfCalc.php

@@ -963,16 +963,7 @@ class PerfCalc {
                 $periodPerf = CalcCache::nowPeriodPerf($userId, $this->_periodNum);
 
                 $userBaseInfo = CalcCache::getUserInfo($userId, $this->_periodNum);
-                //级别必须为VIP
-                $isVip = false;
-                if( $userBaseInfo['DEC_LV'] === DeclarationLevel::VIP_LEVEL_ID ) {
-                    $isVip= true;
-                }
-                if( $this->_sysConfig['vipBonusGoldDecLevel']['VALUE'] && $userBaseInfo['DEC_LV'] === DeclarationLevel::JIN_ZUAN_LEVEL_ID ) {
-                    $isVip = true;
-                }
-
-
+                
                 $nowMonthPerf = [
                     'USER_ID' => $userId,
                     'FX_AMOUNT_CASH' => $everyData['FX_AMOUNT_CASH_SUM'],
@@ -985,13 +976,6 @@ class PerfCalc {
                     'PV_4L' => $everyData['PV_4L_SUM'],
                     'PV_5L' => $everyData['PV_5L_SUM'],
 
-                    //VIP统计相关业绩
-                    'VIP_PV_1L_ZC' => $isVip ? $everyData['PV_1L_ZC_SUM'] : 0,
-                    'VIP_PV_2L_ZC' => $isVip ? $everyData['PV_2L_ZC_SUM'] : 0,
-                    'VIP_PV_3L_ZC' => $isVip ? $everyData['PV_3L_ZC_SUM'] : 0,
-                    'VIP_PV_4L_ZC' => $isVip ? $everyData['PV_4L_ZC_SUM'] : 0,
-                    'VIP_PV_5L_ZC' => $isVip ? $everyData['PV_5L_ZC_SUM'] : 0,
-
                     //总数据,历史+本期。不能用上月加本月,因为上月可能没业绩,上上个月有业绩。
                     'PV_1L_TOTAL' => $periodPerf['PV_1L'] + $userLastPerf['PV_1L'],
                     'PV_2L_TOTAL' => $periodPerf['PV_2L'] + $userLastPerf['PV_2L'],
@@ -1005,7 +989,7 @@ class PerfCalc {
                 CalcCache::addHasMonthPerfUsers($userId, $this->_periodNum);
                 CalcCache::nowMonthPerf($userId, $this->_periodNum, $nowMonthPerf);
 
-                unset($userId, $everyData, $nowMonthPerf, $lastMonthData, $userBaseInfo, $isVip);
+                unset($userId, $everyData, $nowMonthPerf, $lastMonthData, $userBaseInfo);
             }
             unset($allData);
             $this->loopCalcMonthPerfTableData($offset + $this->_limit);

+ 3 - 32
common/helpers/bonus/PreparePerfCalc.php

@@ -844,14 +844,7 @@ class PreparePerfCalc {
                 $periodPerf = PrepareCalcCache::nowPeriodPerf($userId, $this->_periodNum);
 
                 $userBaseInfo = PrepareCalcCache::getUserInfo($userId, $this->_periodNum);
-                //级别必须为VIP
-                $isVip = false;
-                if( $userBaseInfo['DEC_LV'] === DeclarationLevel::VIP_LEVEL_ID ) {
-                    $isVip= true;
-                }
-                if( $this->_sysConfig['vipBonusGoldDecLevel']['VALUE'] && $userBaseInfo['DEC_LV'] === DeclarationLevel::JIN_ZUAN_LEVEL_ID ) {
-                    $isVip = true;
-                }
+
                 // 查询月节点此期业绩,是否包含此用户
                 // 查询perfperiodprepare表中数据,是否有此用户信息.因为是月提前结算,所以此结算期是只有一个数据
                 $monthPrepare = PerfPeriodPrepare::findUseDbCalc()
@@ -903,13 +896,6 @@ class PreparePerfCalc {
                     'PV_4L' => $everyData['PV_4L_SUM'],
                     'PV_5L' => $everyData['PV_5L_SUM'],
 
-                    //VIP统计相关业绩
-                    'VIP_PV_1L_ZC' => $isVip ? $everyData['PV_1L_ZC_SUM'] : 0,
-                    'VIP_PV_2L_ZC' => $isVip ? $everyData['PV_2L_ZC_SUM'] : 0,
-                    'VIP_PV_3L_ZC' => $isVip ? $everyData['PV_3L_ZC_SUM'] : 0,
-                    'VIP_PV_4L_ZC' => $isVip ? $everyData['PV_4L_ZC_SUM'] : 0,
-                    'VIP_PV_5L_ZC' => $isVip ? $everyData['PV_5L_ZC_SUM'] : 0,
-
                     //总数据,历史+本期。不能用上月加本月,因为上月可能没业绩,上上个月有业绩。
                     'PV_1L_TOTAL' => $periodPerf['PV_1L'] + $userLastPerf['PV_1L'],
                     'PV_2L_TOTAL' => $periodPerf['PV_2L'] + $userLastPerf['PV_2L'],
@@ -923,7 +909,7 @@ class PreparePerfCalc {
                 PrepareCalcCache::addHasMonthPerfUsers($userId, $this->_periodNum);
                 PrepareCalcCache::nowMonthPerf($userId, $this->_periodNum, $nowMonthPerf);
 
-                unset($userId, $everyData, $nowMonthPerf, $lastMonthData, $userBaseInfo, $isVip);
+                unset($userId, $everyData, $nowMonthPerf, $lastMonthData, $userBaseInfo);
             }
             unset($allData);
             return $this->loopCalcMonthPerfTableData($offset + $this->_limit);
@@ -977,14 +963,6 @@ class PreparePerfCalc {
                 $periodPerf = PrepareCalcCache::nowPeriodPerf($userId, $this->_periodNum);
 
                 $userBaseInfo = PrepareCalcCache::getUserInfo($userId, $this->_periodNum);
-                //级别必须为VIP
-                $isVip = false;
-                if( $userBaseInfo['DEC_LV'] === DeclarationLevel::VIP_LEVEL_ID ) {
-                    $isVip= true;
-                }
-                if( $this->_sysConfig['vipBonusGoldDecLevel']['VALUE'] && $userBaseInfo['DEC_LV'] === DeclarationLevel::JIN_ZUAN_LEVEL_ID ) {
-                    $isVip = true;
-                }
 
                 $nowMonthPerf = [
                     'USER_ID' => $userId,
@@ -998,13 +976,6 @@ class PreparePerfCalc {
                     'PV_4L' => $everyData['PV_4L_SUM'],
                     'PV_5L' => $everyData['PV_5L_SUM'],
 
-                    //VIP统计相关业绩
-                    'VIP_PV_1L_ZC' => $isVip ? $everyData['PV_1L_ZC_SUM'] : 0,
-                    'VIP_PV_2L_ZC' => $isVip ? $everyData['PV_2L_ZC_SUM'] : 0,
-                    'VIP_PV_3L_ZC' => $isVip ? $everyData['PV_3L_ZC_SUM'] : 0,
-                    'VIP_PV_4L_ZC' => $isVip ? $everyData['PV_4L_ZC_SUM'] : 0,
-                    'VIP_PV_5L_ZC' => $isVip ? $everyData['PV_5L_ZC_SUM'] : 0,
-
                     //总数据,历史+本期。不能用上月加本月,因为上月可能没业绩,上上个月有业绩。
                     'PV_1L_TOTAL' => $periodPerf['PV_1L'] + $userLastPerf['PV_1L'],
                     'PV_2L_TOTAL' => $periodPerf['PV_2L'] + $userLastPerf['PV_2L'],
@@ -1027,7 +998,7 @@ class PreparePerfCalc {
                 );
 
 
-                unset($userId, $everyData, $nowMonthPerf, $lastMonthData, $userBaseInfo, $isVip);
+                unset($userId, $everyData, $nowMonthPerf, $lastMonthData, $userBaseInfo);
             }
             unset($allData);
             return $this->loopCalcMonthPerfTableDataPrepare($offset + $this->_limit);