|
|
|
@ -775,6 +775,7 @@ class Auth extends BaseController |
|
|
|
|
$userInfo = $this->request->userInfo(); |
|
|
|
|
$users = userModel::getDB()->order("uid asc") |
|
|
|
|
->field("uid,spread_uid as sid,spread_uid2 as tid,spread_count,pay_price") |
|
|
|
|
->where('uid', '<>', $userInfo->uid) |
|
|
|
|
->select() |
|
|
|
|
->toArray(); |
|
|
|
|
|
|
|
|
@ -813,7 +814,7 @@ class Auth extends BaseController |
|
|
|
|
foreach ($data as &$item) { |
|
|
|
|
$item['community_level'] = $level[$item['community_level']] ?? ''; |
|
|
|
|
$item['invites'] = $this->countSpInvites($users, $item['uid']); |
|
|
|
|
$item['referrals'] = $this->countSpReferrals($users, $item['tid'], 'pay_price'); |
|
|
|
|
$item['referrals'] = $this->countSpReferrals($users, $item['uid'], 'pay_price'); |
|
|
|
|
if($item['pay_price'] > 0){ |
|
|
|
|
$item['referrals'] += 1; |
|
|
|
|
} |
|
|
|
@ -853,6 +854,9 @@ class Auth extends BaseController |
|
|
|
|
$visited[] = $parentId; // 将当前节点标记为已访问 |
|
|
|
|
|
|
|
|
|
foreach ($nodes as $node) { |
|
|
|
|
if($node['uid'] == $parentId && $node[$field] > 0){ |
|
|
|
|
$count += 1; |
|
|
|
|
} |
|
|
|
|
if ($node['sid'] == $parentId && $node[$field] > 0) { |
|
|
|
|
$count += 1; |
|
|
|
|
$count += $this->countSpReferrals($nodes, $node['uid'], $field, $visited); |
|
|
|
|