dongasai 6 months ago
parent
commit
e1df31c115

+ 1 - 2
app/Module/AppGame/Handler/Promotion/InfoHandler.php

@@ -84,8 +84,7 @@ class InfoHandler extends BaseHandler
                 'user_id' => $this->user_id
             ]);
             // 获取活跃用户统计
-
-            $team_active_count = UrsReferralService::getTeamANumber($this->user_id);
+            $team_active_count = UrsReferralService::getTeamANumber($this->user_id,1);
             // 获取收益统计
             $rewardStats = $this->getRewardStats($ursUserId);
 

+ 1 - 1
app/Module/UrsPromotion/AdminControllers/Actions/ViewReferralChainAction.php

@@ -203,7 +203,7 @@ class ViewReferralChainAction extends RowAction
                 $html .= "<span class='user-info'>URS-{$user['urs_user_id']}</span>";
 
                 if ($user['farm_user_id']) {
-                    $html .= " → 农场用户: {$user['username']} ({$user['nickname']})";
+                    $html .= " → 农场用户ID: {$user['farm_user_id']} | {$user['username']} ({$user['nickname']})";
                 } else {
                     $html .= " → <span class='text-warning'>未进入农场</span>";
                 }

+ 1 - 1
app/Module/UrsPromotion/AdminControllers/Actions/ViewReferralTreeAction.php

@@ -186,7 +186,7 @@ class ViewReferralTreeAction extends RowAction
         $html .= "<span class='user-info'>URS-{$user['urs_user_id']}</span>";
         
         if ($user['farm_user_id']) {
-            $html .= " → 农场用户: {$user['username']} ({$user['nickname']})";
+            $html .= " → 农场用户ID: {$user['farm_user_id']} | {$user['username']} ({$user['nickname']})";
         } else {
             $html .= " → <span class='text-warning'>未进入农场</span>";
         }

+ 4 - 3
app/Module/UrsPromotion/Services/UrsReferralService.php

@@ -198,17 +198,18 @@ class UrsReferralService
 
 
     /**
-     * 获取三级内活跃用户数量
+     * 获取活跃用户数量
      *
      * @param int $userId 农场用户ID
+     * @param int $level
      * @return int 活跃用户数量(映射关系有效且用户活跃)
      */
-    public static function getTeamANumber($userId): int
+    public static function getTeamANumber($userId,$level): int
     {
 
         // 通过关系缓存表获取三代内所有的URS用户ID
         $ursUserIds = \App\Module\UrsPromotion\Models\UrsUserRelationCache::where('related_user_id', $userId)
-            ->where('depth', '<=', 3) // 只统计前3级
+            ->where('depth', '<=', $level) // 只统计前3级
             ->pluck('urs_user_id')
             ->toArray();