|
|
@@ -2788,6 +2788,7 @@ class BonusCalc extends BaseObject {
|
|
|
|
|
|
/**
|
|
|
* 按级别的收入上限
|
|
|
+ * 新的需求调整: 改成不按月进行限制,并且去掉vip奖
|
|
|
* @param $bonus
|
|
|
* @param $userId
|
|
|
* @param $declarationLevel
|
|
|
@@ -2797,18 +2798,7 @@ class BonusCalc extends BaseObject {
|
|
|
$decLevelConfig = $this->_decLevelConfig;
|
|
|
$nowDecLevelConfig = $decLevelConfig[$declarationLevel];
|
|
|
unset($decLevelConfig);
|
|
|
-
|
|
|
- //本月往期奖金 这里执行速度可能慢一些,但需求如此没有办法
|
|
|
- $lastData = CalcCache::lastPeriodMonthCalcBonus($userId, $this->_periodNum, $this->_calcMonth);
|
|
|
- $lastTotal = $lastData['ORI_BONUS_QY_SUM'] + $lastData['ORI_BONUS_VIP_SUM'];
|
|
|
-
|
|
|
- // 从缓存中获取用户的奖金
|
|
|
- $bonusData = CalcCache::bonus($userId, $this->_periodNum);
|
|
|
- $thisTotal = $bonusData['ORI_BONUS_QY'] + $bonusData['ORI_BONUS_VIP'];
|
|
|
- $maxGetBonus = $nowDecLevelConfig['INCOME_CAP'] * $this->_calcMonthPeriodNumCount - $lastTotal - $thisTotal;
|
|
|
- unset($lastData, $lastTotal, $bonusData, $thisTotal);
|
|
|
- if( $maxGetBonus <= 0 ) return 0.00;
|
|
|
-
|
|
|
+ $maxGetBonus = $nowDecLevelConfig['INCOME_CAP'];
|
|
|
if( $bonus <= $maxGetBonus) {
|
|
|
return $bonus;
|
|
|
}else {
|
|
|
@@ -2816,6 +2806,29 @@ class BonusCalc extends BaseObject {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ // public function declarationLevelCap($bonus, $userId, $declarationLevel) {
|
|
|
+ // $decLevelConfig = $this->_decLevelConfig;
|
|
|
+ // $nowDecLevelConfig = $decLevelConfig[$declarationLevel];
|
|
|
+ // unset($decLevelConfig);
|
|
|
+
|
|
|
+ // //本月往期奖金 这里执行速度可能慢一些,但需求如此没有办法
|
|
|
+ // $lastData = CalcCache::lastPeriodMonthCalcBonus($userId, $this->_periodNum, $this->_calcMonth);
|
|
|
+ // $lastTotal = $lastData['ORI_BONUS_QY_SUM'] + $lastData['ORI_BONUS_VIP_SUM'];
|
|
|
+
|
|
|
+ // // 从缓存中获取用户的奖金
|
|
|
+ // $bonusData = CalcCache::bonus($userId, $this->_periodNum);
|
|
|
+ // $thisTotal = $bonusData['ORI_BONUS_QY'] + $bonusData['ORI_BONUS_VIP'];
|
|
|
+ // $maxGetBonus = $nowDecLevelConfig['INCOME_CAP'] * $this->_calcMonthPeriodNumCount - $lastTotal - $thisTotal;
|
|
|
+ // unset($lastData, $lastTotal, $bonusData, $thisTotal);
|
|
|
+ // if( $maxGetBonus <= 0 ) return 0.00;
|
|
|
+
|
|
|
+ // if( $bonus <= $maxGetBonus) {
|
|
|
+ // return $bonus;
|
|
|
+ // }else {
|
|
|
+ // return $maxGetBonus;
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+
|
|
|
/**
|
|
|
* 总奖金限制
|
|
|
* @param $bonus
|