|
|
@@ -33,6 +33,7 @@ use common\models\CalcBonusXF;
|
|
|
use common\models\CalcBonusYC;
|
|
|
use common\models\CalcBonusYJ;
|
|
|
use common\models\CalcMonthBonusUser;
|
|
|
+use common\models\Config;
|
|
|
use common\models\FlowDeductZR;
|
|
|
use common\models\PerfCompany;
|
|
|
use common\models\PerfMonth;
|
|
|
@@ -1455,6 +1456,12 @@ class BonusCalc extends BaseObject {
|
|
|
if ($allData) {
|
|
|
echo sprintf("时间:[%s]共享奖,当前offset为:【%s】" . PHP_EOL, date('Y-m-d H:i:s', time()) , $offset);
|
|
|
$insertBonusData = [];
|
|
|
+ // 获取线上找几层和是否开启找几层的限制
|
|
|
+ $configsGx = Config::find()->where(
|
|
|
+ 'CONFIG_NAME="gxNoPvFindLimitSwitch" OR CONFIG_NAME="gxNoPvFindLimitTimes"'
|
|
|
+ )->orderBy('SORT ASC')->indexBy('CONFIG_NAME')->asArray()->all();
|
|
|
+ $openFindLimit = isset($configsGx['gxNoPvFindLimitSwitch']) ? $configsGx['gxNoPvFindLimitSwitch']['VALUE'] : 1; // 是否开放了 得奖人不满足980就找一个满足980的人来得这个奖 的最大向上循环次数
|
|
|
+ $findLimitTimes = isset($configsGx['gxNoPvFindLimitTimes']) ? $configsGx['gxNoPvFindLimitTimes']['VALUE'] : 5 ; // 开放的限制层数
|
|
|
foreach ($allData as $userId) {
|
|
|
$bonusUserData = [];
|
|
|
$bonusPercentOne = $this->_sysConfig['shareRecPercent']['VALUE'] / 100;
|
|
|
@@ -1515,7 +1522,7 @@ class BonusCalc extends BaseObject {
|
|
|
// unset($bonusUserDataEvery, $bonusUserId);
|
|
|
// continue;
|
|
|
//得奖人不满足980就找一个满足980的人来得这个奖
|
|
|
- $bonusUserId = $this->getMinBdPvNetworkParent($bonusUserId);
|
|
|
+ $bonusUserId = $this->getMinBdPvNetworkParent($bonusUserId, $openFindLimit, $findLimitTimes);
|
|
|
if ( !$bonusUserId ) {
|
|
|
unset($bonusUserDataEvery, $bonusUserId);
|
|
|
continue;
|
|
|
@@ -2774,19 +2781,17 @@ class BonusCalc extends BaseObject {
|
|
|
* @param $userId
|
|
|
* @return string
|
|
|
*/
|
|
|
- public function getMinBdPvNetworkParent($userId) {
|
|
|
+ public function getMinBdPvNetworkParent($userId, $openFindLimit = 1, $findLimitTimes = 5) {
|
|
|
$validParentId = '';
|
|
|
$validDeep = 1;
|
|
|
- $startSwitch = self::GX_LIMIT_SWITCH;
|
|
|
- $floorNum = self::GX_FLOOR_LIMIT;
|
|
|
- $this->loopNetworkParentDo($userId, function ($parent) use(&$validParentId,&$validDeep,$startSwitch,$floorNum) {
|
|
|
+ $this->loopNetworkParentDo($userId, function ($parent) use(&$validParentId,&$validDeep,$openFindLimit,$findLimitTimes) {
|
|
|
if ( $this->checkSmallMarketPerf($parent['PARENT_UID']) ) {
|
|
|
$validParentId = $parent['PARENT_UID'];
|
|
|
unset($parent);
|
|
|
return self::LOOP_FINISH;
|
|
|
}
|
|
|
// 只找5层
|
|
|
- if ( $startSwitch && $validDeep >= $floorNum ) {
|
|
|
+ if ( $openFindLimit && $validDeep >= $findLimitTimes ) {
|
|
|
unset($parent);
|
|
|
return self::LOOP_FINISH;
|
|
|
}
|