PHPackages                             chenzeshu/chen-utils - 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. chenzeshu/chen-utils

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

chenzeshu/chen-utils
====================

functions collected

0.0.6(8y ago)032MITPHP

Since Sep 20Pushed 8y agoCompare

[ Source](https://github.com/chenzeshu/chen-utils)[ Packagist](https://packagist.org/packages/chenzeshu/chen-utils)[ RSS](/packages/chenzeshu-chen-utils/feed)WikiDiscussions master Synced 4d ago

READMEChangelogDependenciesVersions (7)Used By (0)

Chen-utils
==========

[](#chen-utils)

traits
------

[](#traits)

```
1.use for time-style
2.use for array
3.use for curl
4.use for value-check
5.use for json-return-format
6.use for auto_api_age

```

facades
-------

[](#facades)

```
1. ChenUtilFacade
   - getWechatOpenid & session-key
   - getAccess_token
expect to do :
   - apis for wechatPay

```

各个traits的用法
-----------

[](#各个traits的用法)

### 1. PageTrait

[](#1-pagetrait)

用法:

1. 建议创建一个`ApiController`, 继承`Controller`, 然后将其他`Restful Controller`继承本Controller;
2. `ApiController`中`use PageTrait;`

### API:

[](#api)

1. getPaginator($page, $pageSize)
2. getSearch($page, $pageSize, $needleName, $needle)

参数意义`$page`页码`$pageSize`每页数量`$needleName`模糊搜索的字段名`$needle`模糊搜索的内容配合`ReturnTrait`返回数据格式:

```
code:$code,
msg:$msg,
data:[
    'data'=>$data,
    'total'=>$total //页码总数
]

```

注意: 本Trait默认`User.php`在`app/`目录下

1. 使用了递归, 可以下探Models文件夹下所有模型文件
2. wating to do: 问题1: 目前就做了三层, 从app目录下, 到app/models目录下, 再到下一级 暂时没有递归文件夹的思路

    问题2: 如分类连表查询等还没有做

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community6

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

Total

6

Last Release

3134d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2b1490d2165599f4cef936b88ee7655e8c0ad619794c37b8ec1c1212a0025f99?d=identicon)[chenzeshu](/maintainers/chenzeshu)

---

Top Contributors

[![chenzeshu](https://avatars.githubusercontent.com/u/20907591?v=4)](https://github.com/chenzeshu "chenzeshu (14 commits)")

### Embed Badge

![Health badge](/badges/chenzeshu-chen-utils/health.svg)

```
[![Health](https://phpackages.com/badges/chenzeshu-chen-utils/health.svg)](https://phpackages.com/packages/chenzeshu-chen-utils)
```

PHPackages © 2026

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