|
|
@@ -571,11 +571,11 @@ class CalcServeBonusCalc extends BaseObject {
|
|
|
$periodNum = $this->_periodNum;
|
|
|
// 从缓存获取分页有业绩的会员信息
|
|
|
$allData = CalcCache::getHasPerfUsers($this->_periodNum, $offset, $this->_limit);
|
|
|
-// if ($allData) {
|
|
|
-// $insertBonusData = [];
|
|
|
-// foreach ($allData as $userId) {
|
|
|
-// // 从缓存中获取会员的业绩信息
|
|
|
-// $perfData = CalcCache::nowPeriodPerf($userId, $periodNum);
|
|
|
+ if ($allData) {
|
|
|
+ $insertBonusData = [];
|
|
|
+ foreach ($allData as $userId) {
|
|
|
+ // 从缓存中获取会员的业绩信息
|
|
|
+ $perfData = CalcCache::nowPeriodPerf($userId, $periodNum);
|
|
|
// if( !$perfData ) continue;
|
|
|
// $decRoleBonusFrom = explode(',', $this->_sysConfig['decRoleBonusFrom']['VALUE']);
|
|
|
// $validPvPcs = 0;
|
|
|
@@ -621,45 +621,16 @@ class CalcServeBonusCalc extends BaseObject {
|
|
|
// //记录奖金和奖金来源到缓存 并实现在缓存中奖金累加
|
|
|
// CalcCache::saveFwBonusList($bonusUserId, $this->_periodNum, $fwBonus, ['fromUid'=>$userId, 'fromPvPcs'=>$validPvPcs]);
|
|
|
// CalcCache::addHasFwBonusUsers($bonusUserId, $this->_periodNum);
|
|
|
-//
|
|
|
-//// $this->loopRelationParentDo($userId, function ($parent) use($userId, $validPvPcs){
|
|
|
-//// try {
|
|
|
-//// //判断parent的报单中心级别 和 服务奖比例
|
|
|
-//// $bonusUserId = $parent['PARENT_UID'];
|
|
|
-//// //计算级别之后更新过userInfo的缓存,缓存中级别发生了变化
|
|
|
-//// $bonusUserInfo = CalcCache::getUserInfo($bonusUserId, $this->_periodNum);
|
|
|
-//// $isDec = $bonusUserInfo['IS_DEC'];
|
|
|
-//// if($isDec == 0) return self::LOOP_CONTINUE;
|
|
|
-//// $decRoleId = $bonusUserInfo['DEC_ROLE_ID'];
|
|
|
-//// if( !$decRoleId ) return self::LOOP_CONTINUE;
|
|
|
-//// if( !isset($this->_decRoleConfig[$decRoleId]) ) return self::LOOP_CONTINUE;
|
|
|
-////
|
|
|
-//// $parentDecRoleLevel = $this->_decRoleConfig[$decRoleId];
|
|
|
-//// $parentFwBonusPercent = $parentDecRoleLevel['FW_BONUS_PERCENT'] ?? 0;
|
|
|
-//// $cacheMaxPercent = CalcCache::fwMaxBonusPercent($userId, $this->_periodNum);
|
|
|
-//// $diffPercent = $parentFwBonusPercent - $cacheMaxPercent;
|
|
|
-//// if( $diffPercent <= 0 ) return self::LOOP_CONTINUE;
|
|
|
-////
|
|
|
-//// $fwBonus = $validPvPcs * $diffPercent / 100;
|
|
|
-//// if( $fwBonus <= 0 ) return self::LOOP_CONTINUE;
|
|
|
-////
|
|
|
-//// //给本人添加服务奖比例
|
|
|
-//// CalcCache::fwMaxBonusPercent($userId, $this->_periodNum, $parentFwBonusPercent);
|
|
|
-//// //记录奖金和奖金来源到缓存 并实现在缓存中奖金累加
|
|
|
-//// CalcCache::saveFwBonusList($bonusUserId, $this->_periodNum, $fwBonus, ['fromUid'=>$userId, 'fromPvPcs'=>$validPvPcs]);
|
|
|
-//// CalcCache::addHasFwBonusUsers($bonusUserId, $this->_periodNum);
|
|
|
-//// } catch(Exception $e) {
|
|
|
-//// var_dump($e->getMessage(), '------------');
|
|
|
-//// }
|
|
|
-//// unset($bonusUserId, $bonusUserInfo, $isDec, $decRoleId, $parentDecRoleLevel, $parentFwBonusPercent, $cacheMaxPercent, $diffPercent, $fwBonus);
|
|
|
-//// });
|
|
|
-//
|
|
|
-// unset($userId, $validPvPcs);
|
|
|
-// }
|
|
|
-// unset($allData, $insertBonusData);
|
|
|
-// return $this->calcBonusBDStepOne($offset + $this->_limit);
|
|
|
-// }
|
|
|
-// unset($allData);
|
|
|
+
|
|
|
+
|
|
|
+ unset($userId, $validPvPcs);
|
|
|
+ }
|
|
|
+
|
|
|
+ unset($allData, $insertBonusData);
|
|
|
+ return $this->calcBonusBDStepOne($offset + $this->_limit);
|
|
|
+ }
|
|
|
+
|
|
|
+ unset($allData);
|
|
|
return true;
|
|
|
}
|
|
|
|