|
|
@@ -1313,7 +1313,6 @@ class PerfCalc {
|
|
|
$userId = $everyData['USER_ID'];
|
|
|
$pv = $everyData['MONTH_PV'];
|
|
|
$userBaseInfo = CalcCache::getUserInfo($userId, $this->_periodNum);
|
|
|
- $userRelation = CalcCache::getUserRelationInfo($userId, $this->_periodNum);
|
|
|
// 记录有业绩单的用户
|
|
|
StorePerfLog::addOrUpdate(
|
|
|
$this->_periodNum,
|
|
|
@@ -1325,8 +1324,7 @@ class PerfCalc {
|
|
|
'MONTH_PV' => $pv,
|
|
|
'PERIOD_NUM' => $this->_periodNum,
|
|
|
'CALC_MONTH' => $this->_calcYearMonth,
|
|
|
- 'CREATE_AT' => time(),
|
|
|
- 'PARENT_UID' => $userRelation['PARENT_UID']
|
|
|
+ 'CREATE_AT' => time()
|
|
|
],
|
|
|
$pv
|
|
|
);
|
|
|
@@ -1336,11 +1334,13 @@ class PerfCalc {
|
|
|
CalcCache::nowPeriodPerf($userId, $this->_periodNum, [
|
|
|
'STORE_PV_GRAND' => $pv,
|
|
|
]);
|
|
|
+ StorePerfLog::stParendStudio($this->_periodNum,$this->_calcYearMonth, [$userId], $userId);
|
|
|
} else {
|
|
|
+ $allUser = [];
|
|
|
+ $studioUid = '';
|
|
|
// 如果此用户不是店铺,继续上找到店铺并累加上去PV
|
|
|
- $this->loopRelationParentDo($userId, function ($parent) use (&$everyData) {
|
|
|
+ $this->loopRelationParentDo($userId, function ($parent) use (&$everyData,&$allUser,&$studioUid) {
|
|
|
$parentUser = CalcCache::getUserInfo($parent['PARENT_UID'], $this->_periodNum);
|
|
|
- $userRelation = CalcCache::getUserRelationInfo($parent['PARENT_UID'], $this->_periodNum);
|
|
|
StorePerfLog::addOrUpdate(
|
|
|
$this->_periodNum,
|
|
|
$this->_calcYearMonth,
|
|
|
@@ -1351,22 +1351,24 @@ class PerfCalc {
|
|
|
'MONTH_PV' => 0,
|
|
|
'PERIOD_NUM' => $this->_periodNum,
|
|
|
'CALC_MONTH' => $this->_calcYearMonth,
|
|
|
- 'CREATE_AT' => time(),
|
|
|
- 'PARENT_UID' => $userRelation['PARENT_UID']
|
|
|
+ 'CREATE_AT' => time()
|
|
|
],
|
|
|
$everyData['MONTH_PV']
|
|
|
);
|
|
|
+ array_push($allUser, $parent['PARENT_UID']);
|
|
|
if ($parentUser['IS_STUDIO']) {
|
|
|
CalcCache::nowPeriodPerf($parent['PARENT_UID'], $this->_periodNum, [
|
|
|
'STORE_PV_GRAND' => $everyData['MONTH_PV']
|
|
|
]);
|
|
|
CalcCache::addHasPerfUsers($parent['PARENT_UID'], $this->_periodNum);
|
|
|
-
|
|
|
+ $studioUid = $parent['PARENT_UID'];
|
|
|
return self::LOOP_FINISH;
|
|
|
}
|
|
|
|
|
|
unset($parent);
|
|
|
});
|
|
|
+ array_push($allUser, $userId);
|
|
|
+ StorePerfLog::stParendStudio($this->_periodNum,$this->_calcYearMonth, $allUser, $studioUid);
|
|
|
}
|
|
|
}
|
|
|
unset($allData);
|