|
|
@@ -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();
|
|
|
|