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