|
|
@@ -393,6 +393,15 @@ class StoreOrderSuccessServices extends BaseServices
|
|
|
$isSlippedMember = ($originalPid != $originalFakePid);
|
|
|
$hasGivenToFakePid = false; // 是否已经给fake_id发放过见点奖
|
|
|
|
|
|
+ // 获取购买用户直推上级的推荐关系,用于判断是否需要分成
|
|
|
+ $directParentRelation = null;
|
|
|
+ if ($originalPid > 0) {
|
|
|
+ $directParentRelation = $giftGroupService->getOne([
|
|
|
+ 'product_id' => $product_id,
|
|
|
+ 'uid' => $originalPid
|
|
|
+ ]);
|
|
|
+ }
|
|
|
+
|
|
|
for ($i = 0; $i < $spotUpLimit; $i++) {
|
|
|
$nextUid = null;
|
|
|
|
|
|
@@ -420,9 +429,10 @@ class StoreOrderSuccessServices extends BaseServices
|
|
|
@file_put_contents('quanju4.txt', '分成原因:购买用户是滑落的,第一次给fake_id发放' . "\r\n", 8);
|
|
|
}
|
|
|
// 情况2:购买用户的直推上级是滑落的,且第一次给该直推上级的fake_id发放
|
|
|
- else if (!$hasGivenToFakePid && $currentUid == $originalPid && !empty($currentRelation['fake_pid']) && $nextUid == $currentRelation['fake_pid'] && $currentRelation['pid'] != $currentRelation['fake_pid']) {
|
|
|
+ // 判断条件:nextUid 是购买用户直推上级的 fake_id,且直推上级是滑落的
|
|
|
+ else if (!$hasGivenToFakePid && $directParentRelation && !empty($directParentRelation['fake_pid']) && $nextUid == $directParentRelation['fake_pid'] && $directParentRelation['pid'] != $directParentRelation['fake_pid']) {
|
|
|
$needSplit = true;
|
|
|
- $splitTargetPid = $currentRelation['pid'];
|
|
|
+ $splitTargetPid = $directParentRelation['pid'];
|
|
|
$hasGivenToFakePid = true;
|
|
|
@file_put_contents('quanju4.txt', '分成原因:购买用户的直推上级是滑落的,第一次给该直推上级的fake_id发放' . "\r\n", 8);
|
|
|
}
|