PHPackages                             he426100/hyperf-user-relation - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. he426100/hyperf-user-relation

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

he426100/hyperf-user-relation
=============================

hyperf上下级关系组件

3.1.0(2y ago)019MITPHPPHP &gt;=8.1

Since Feb 23Pushed 2y ago1 watchersCompare

[ Source](https://github.com/he426100/hyperf-user-relation)[ Packagist](https://packagist.org/packages/he426100/hyperf-user-relation)[ RSS](/packages/he426100-hyperf-user-relation/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (5)Versions (5)Used By (0)

hyperf-user-relation
====================

[](#hyperf-user-relation)

受[jtar-hyperf-user-node](https://github.com/taobali32/jtar-hyperf-user-node)启发，把自己常用的用户关系实现发出来

Installation
------------

[](#installation)

- Request

```
composer require he426100/hyperf-user-relation
```

- Publish

```
php bin/hyperf.php vendor:publish he426100/hyperf-user-relation
```

用户关系表参考

```
CREATE TABLE `user_relation`  (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `parent_id` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '父级ID',
  `user_id` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '会员ID',
  `level` int(11) UNSIGNED NOT NULL DEFAULT 1 COMMENT '关系等级',
  `create_time` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建时间',
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE INDEX `parent_user_index`(`parent_id`, `user_id`) USING BTREE,
  UNIQUE INDEX `user_level_index`(`user_id`, `level`) USING BTREE,
  INDEX `rds_idx_0`(`user_id`, `parent_id`, `level`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = COMPACT;

```

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~93 days

Total

4

Last Release

900d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/f496f5618977a1eeb3f64de28aa1a130e33c0c3f847043177f7496916cc8eecf?d=identicon)[he426100](/maintainers/he426100)

---

Tags

hyperf

###  Code Quality

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/he426100-hyperf-user-relation/health.svg)

```
[![Health](https://phpackages.com/badges/he426100-hyperf-user-relation/health.svg)](https://phpackages.com/packages/he426100-hyperf-user-relation)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
