getTeamInfo($userId); } catch (\Exception $e) { Log::error('获取用户团队信息失败', [ 'user_id' => $userId, 'error' => $e->getMessage(), 'trace' => $e->getTraceAsString() ]); return null; } } /** * 添加推荐关系 * * @param int $userId * @param int $referrerId * @return bool */ public static function addReferral(int $userId, int $referrerId): bool { try { $teamLogic = new TeamLogic(); return $teamLogic->addReferral($userId, $referrerId); } catch (\Exception $e) { Log::error('添加推荐关系失败', [ 'user_id' => $userId, 'referrer_id' => $referrerId, 'error' => $e->getMessage(), 'trace' => $e->getTraceAsString() ]); return false; } } /** * 更新用户达人信息 * * @param int $userId * @return bool */ public static function updateTalentInfo(int $userId): bool { try { $teamLogic = new TeamLogic(); return $teamLogic->updateTalentInfo($userId); } catch (\Exception $e) { Log::error('更新达人信息失败', [ 'user_id' => $userId, 'error' => $e->getMessage(), 'trace' => $e->getTraceAsString() ]); return false; } } /** * 获取用户的团队收益记录 * * @param int $userId * @param int $limit * @return Collection */ public static function getTeamProfits(int $userId, int $limit = 100): Collection { try { $teamLogic = new TeamLogic(); return $teamLogic->getTeamProfits($userId, $limit); } catch (\Exception $e) { Log::error('获取用户团队收益记录失败', [ 'user_id' => $userId, 'limit' => $limit, 'error' => $e->getMessage(), 'trace' => $e->getTraceAsString() ]); return collect(); } } }