PHPackages                             nbczwphp/authdata - 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. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. nbczwphp/authdata

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

nbczwphp/authdata
=================

数据级权限

v1.0.1(5y ago)02MITPHPCI failing

Since Jul 16Pushed 5y ago1 watchersCompare

[ Source](https://github.com/nbczw8750/authdata)[ Packagist](https://packagist.org/packages/nbczwphp/authdata)[ RSS](/packages/nbczwphp-authdata/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (2)Dependencies (2)Versions (3)Used By (0)

ThinkPHP5 数据级权限
===============

[](#thinkphp5-数据级权限)

使用规则引擎,进行数据级权限的筛选

创建表
---

[](#创建表)

```
CREATE TABLE `auth_data` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL COMMENT '规则',
  `title` varchar(255) NOT NULL COMMENT '名称',
  `sql` varchar(255) DEFAULT NULL COMMENT 'sql语句',
  `status` tinyint(1) DEFAULT '1' COMMENT '状态',
  PRIMARY KEY (`id`),
  UNIQUE KEY `name` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='数据级权限规则引擎表';

```

技巧
--

[](#技巧)

1. 规则`name`字段可以是`模块/控制器/方法`
2. 查出的`sql`值，直接传入`where`方法
3. 查出的`sql`值里有变量值，可以解析后再使用，例uid={user\_id} and name like '{name}，变量{xxx}表示

###  Health Score

24

—

LowBetter than 31% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity2

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

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 ~0 days

Total

2

Last Release

2179d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/299441?v=4)[nbczw8750](/maintainers/nbczw8750)[@nbczw8750](https://github.com/nbczw8750)

---

Top Contributors

[![nbczw8750](https://avatars.githubusercontent.com/u/299441?v=4)](https://github.com/nbczw8750 "nbczw8750 (2 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/nbczwphp-authdata/health.svg)

```
[![Health](https://phpackages.com/badges/nbczwphp-authdata/health.svg)](https://phpackages.com/packages/nbczwphp-authdata)
```

###  Alternatives

[vitalybaev/laravel5-dkim

Laravel 5/6 package for signing outgoing messages with DKIM.

3163.1k](/packages/vitalybaev-laravel5-dkim)

PHPackages © 2026

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