PHPackages                             webman-micro/base - 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. [Framework](/categories/framework)
4. /
5. webman-micro/base

ActiveLibrary[Framework](/categories/framework)

webman-micro/base
=================

Webman plugin webman-micro/base

0.1.3(1y ago)08MITPHP

Since Oct 24Pushed 1y ago1 watchersCompare

[ Source](https://github.com/webman-micro/base)[ Packagist](https://packagist.org/packages/webman-micro/base)[ RSS](/packages/webman-micro-base/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (4)Dependencies (3)Versions (5)Used By (0)

说明
==

[](#说明)

本包为开发中用到的基类，仅支持TP ORM

过滤条件设计
======

[](#过滤条件设计)

[![](/images/filter.png)](/images/filter.png)

如上图所示，一个复杂的查询条件是可以分组逻辑or后与另外一个分组整体逻辑or，要实现这样逻辑有两种方案。

方案说明1、多维数组递归组装缺点数据很难验证和处理2、一维数组 + 一个字符串规则❤️优势处理简单，需要严格限制字符串规则，防止sql注入> 当前我选择了方案2

方案参数说明
------

[](#方案参数说明)

多条数据参数设计：

```
{
    "filter": {
        "param": {
            "id#1" : ["-eq", 2],
            "id#2" : ["-eq", 3],
            "phone" : ["-eq", 18888888888],
            "name" : ["-lk", "xxx"]
        },
        "rule": "(id {id#1} or phone {phone}) or (name {name} and id {id#2})"
    },
    "order": [
        {
            "field": "id",
            "order": "asc"
        }
    ],
    "page": [
        1,
        200
    ]
}
```

### 1. filter参数设计

[](#1-filter参数设计)

filter 必须使用 {"param": {}, "rule": ""} 参数结构

1.1 param 格式必须为 id : \["-eq", 2\]（字段: \[过滤方法, 过滤参数\]）

过滤方法说明-gt&gt; 大于-egt&gt;= 大于等于-lt&gt;= 小于-lkLIKE 包含-not-lkNOT LIKE 不包含-eq= 等于-neq&lt;&gt; 不等于-find\_in\_setfind\_in\_set 在字符串里面-bwBETWEEN 在两个参数之间范围-not-bwNOT BETWEEN 不在两个参数之间范围-inIN 在列表之中-not-inNOT IN 不在列表之中1.2 字段名为验证方法 queryFilter:id,name 后面跟着的rule是当前允许查询的字段

> 可能存在一个字段被表达式多次使用且参数和过滤方法不一样，可以采用如下方式：

> param key 规则：字段名#数字

```
{
  "param": {
    "id#1" : ["-eq", 2],
    "id#2" : ["-eq", 3]
  }
}
```

2.1 rule 只能包含，param里面字段名允许的字段和 () {} 空格

> 用()分组，{字段}这里会被参数替换的部分，字段等于param参数的key值

`(id {id#1} or phone {phone}) or (name {name} and id {id#2})`

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance37

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity32

Early-stage or recently created project

 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

4

Last Release

571d ago

### Community

Maintainers

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

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/webman-micro-base/health.svg)

```
[![Health](https://phpackages.com/badges/webman-micro-base/health.svg)](https://phpackages.com/packages/webman-micro-base)
```

###  Alternatives

[nolimits4web/swiper

Most modern mobile touch slider and framework with hardware accelerated transitions

41.8k177.2k1](/packages/nolimits4web-swiper)[laravel/prompts

Add beautiful and user-friendly forms to your command-line applications.

712181.8M596](/packages/laravel-prompts)[cakephp/chronos

A simple API extension for DateTime.

1.4k47.7M121](/packages/cakephp-chronos)[laravel/pail

Easily delve into your Laravel application's log files directly from the command line.

91545.3M590](/packages/laravel-pail)[nette/bootstrap

🅱 Nette Bootstrap: the simple way to configure and bootstrap your Nette application.

68535.8M592](/packages/nette-bootstrap)[cakephp/utility

CakePHP Utility classes such as Inflector, String, Hash, and Security

12127.1M63](/packages/cakephp-utility)

PHPackages © 2026

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