PHPackages                             mmxs/mmapi - 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. mmxs/mmapi

ActiveLibrary[Framework](/categories/framework)

mmxs/mmapi
==========

frameworkphp

4.1.11(8y ago)05351PHP

Since Dec 14Pushed 8y ago1 watchersCompare

[ Source](https://github.com/mingmingxianseng/mmapi)[ Packagist](https://packagist.org/packages/mmxs/mmapi)[ RSS](/packages/mmxs-mmapi/feed)WikiDiscussions master Synced 4w ago

READMEChangelog (6)Dependencies (3)Versions (55)Used By (1)

12-16 1.增加图片上传类 支持阿里云OSS 2.优化APP类 3.增加DB缓存 4:优化Api #17-01-15 1:优化api接口类 2:增加api接口防止重复提交表单的功能 3:修复DB缓存无效的bug 4:增加ApiException

\#17-01-16 ####api接口增加必传参数抛出特殊异常的功能 / \*\*\*\* \*@desc setRequire 传一个参数 类型可以有以下4种 \*array 该参数必传， 抛出一个msg和code的ApiException \*字符串 该参数必传，若没有穿 抛出一个ApiException错误描述 \*设置false 即该参数非必传 \*\*\*\*/

```
$this->addParam('id')->setRequire(['id必须传递', 'ID_MUST']);
$this->addParam('id')->setRequire('id必须传递');
$this->addParam('id')->setRequire(false);
$this->addParam('id')->setRequire(true);

```

\####api增加防止重复提交的功能 解决一些对数据库有更新、插入或者删除操作的接口，如果前端产生并发，会产生重复记录的问题 *代码样例*

```
protected function init()
{
    $this->addParam('id')->setRequire(false);
    $this->addParam('categoryId')->setType(ApiParams::TYPE_INT)->setRequire(false)->setDefault(0);
    $this->addParam('list')->setType(ApiParams::TYPE_ARRAY);
    $this->addParam('name');
    $this->denyResubmit();
}

```

\##2017-01-20 php版本升级到7.1 \\Exception 变更为 \\Throwable

\##2017-02-06 sqlBuilder 新增 like 支持 并支持 match 模糊匹配 自动过滤 % 和 \_

\##2017-02-08 支持微信支付 ###初始化 Config::batchSet(\['wxpay' =&gt; \[ 'app\_id' =&gt; 'wx\*\*\*\*\*\*', 'mch\_id' =&gt; 127\*\*\*\*\*\*\*\*, 'app\_key' =&gt; '\*\*\*\*\*\*',//api key 'cert\_path' =&gt; **DIR** . '/cert/apiclient\_cert.pem', 'key\_path' =&gt; **DIR** . '/cert/apiclient\_key.pem', 'rootca\_path' =&gt; **DIR** . '/cert/rootca.pem', \]\]); $this-&gt;pay = new Pay(Config::get('wxpay')); $this-&gt;outTradeNo = '201702081642188710'; ###创建订单
$request = $this-&gt;pay-&gt;create(); $request -&gt;setBody('test') -&gt;setOutTradeNo($this-&gt;outTradeNo) -&gt;setTotalFee(1) -&gt;setNotifyUrl('') -&gt;setTradeType(CreateOrderRequest::TRADE\_TYPE\_APP) -&gt;setSpbillCreateIp('192.168.1.1') -&gt;send();
if ($response-&gt;isSuccessful()) { //退款成功 } else { echo $response-&gt;getError(); } ###查询订单

```
$request = $this->pay->query();
$request->setOutTradeNo($this->outTradeNo)->send();
if ($response->isSuccessful()) {
    $payData = $response->getData();
} else {
    echo $response->getError();
}

```

\###关闭订单 $response = $this-&gt;pay-&gt;close($this-&gt;outTradeNo); if ($response-&gt;isSuccessful()) { //关闭成功 } else { //关闭失败 获取失败原因 echo $response-&gt;getError(); }

### 申请退款

[](#申请退款)

```
$request = $this->pay->refund();

$response = $request
    ->setOutTradeNo($this->outTradeNo)
    ->setOutRefundNo(date('YmdHis') . mt_rand(10, 99))
    ->setTotalFee(1000)
    ->setRefundFee(1000)
    ->send();

if ($response->isSuccessful()) {
    //退款成功
} else {
     //失败 获取失败原因
    echo $response->getError();
}

```

### 查询退款窗台

[](#查询退款窗台)

```
$request = $this->pay->queryRefund();
$response = $request->setOutTradeNo('201701191906141174')
    ->send();
if ($response->isSuccessful()) {
    //退款成功
} else {
    echo $response->getError();
}

```

\##2017-02-09

修复sqlBuilder join 3张表的bug

\##2017-02-19

增加根据不同域名加载不同配置的功能

\##2017-03-02

model不会立即更新 走flush流程

\##2017-03-04

不同类型的日志可以分开文件存放

sql 日志可以打印出datetime类型的绑定变量

\##2017-03-05 优化sql日志 db 事务的处理 传递一个闭包即可

\##2017-03-06 优化参数赋值 如果从目标传参方式中取不到值 则不填充value

\##2017-03-31 缓存只支持memcached 和redis 放弃其他缓存

\##2017-04-12 支持post原始数据的参数 ##2017-05-08 entity preFlush 日志记录 获取用户真实ip ##2017-05-16 优化接口抛出异常方式

###  Health Score

33

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity77

Established project with proven stability

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

Recently: every ~37 days

Total

52

Last Release

3185d ago

Major Versions

1.1 → 3.22017-01-02

3.8.10 → 4.0.02017-03-02

### Community

Maintainers

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

---

Top Contributors

[![mingmingxianseng](https://avatars.githubusercontent.com/u/20384024?v=4)](https://github.com/mingmingxianseng "mingmingxianseng (28 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mmxs-mmapi/health.svg)

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

###  Alternatives

[pimcore/pimcore

Content &amp; Product Management Framework (CMS/PIM/E-Commerce)

3.8k3.8M465](/packages/pimcore-pimcore)[neuron-core/neuron-ai

The PHP Agentic Framework.

2.0k496.1k34](/packages/neuron-core-neuron-ai)[tempest/framework

The PHP framework that gets out of your way.

2.2k31.1k12](/packages/tempest-framework)[oro/platform

Business Application Platform (BAP)

642140.7k105](/packages/oro-platform)[open-dxp/opendxp

Content &amp; Product Management Framework (CMS/PIM)

9417.2k58](/packages/open-dxp-opendxp)[rcsofttech/audit-trail-bundle

Enterprise-grade, high-performance Symfony audit trail bundle. Automatically track Doctrine entity changes with split-phase architecture, multiple transports (HTTP, Queue, Doctrine), and sensitive data masking.

1175.2k](/packages/rcsofttech-audit-trail-bundle)

PHPackages © 2026

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