PHPackages                             jxlau/meituan-pub-union - 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. jxlau/meituan-pub-union

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

jxlau/meituan-pub-union
=======================

美团分销联盟 PHP-SDK

1.1.1(3y ago)024MITPHPPHP &gt;=7.0

Since Jun 7Pushed 3y ago1 watchersCompare

[ Source](https://github.com/JXLau/meituan-pub-union)[ Packagist](https://packagist.org/packages/jxlau/meituan-pub-union)[ RSS](/packages/jxlau-meituan-pub-union/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (4)Used By (0)

 meituan-pub-union
===================

[](#-meituan-pub-union-)

 🌈 美团分销联盟 PHP-SDK.

安装
--

[](#安装)

```
$ composer require jxlau/meituan-pub-union
```

配置
--

[](#配置)

在使用本扩展之前，你需要去 [美团分销联盟](https://pub.meituan.com) 注册账号，签约入驻后创建应用，获取应用的 app\_key 和 utm\_source。

支持
--

[](#支持)

- ✅ 获取全国省份 `ProvinceAllRequest`
- ✅ 获取某省份的城市 `CitiesRequest`
- ✅ 获取某个城市的一级类目包含的二级类目信息 `CategoriesRequest`
- ✅ 获取某个城市的商圈信息（点评）`RegionsByDianPingRequest`
- ✅ 获取某个城市的商圈信息（美团）`RegionsByMeiTuanRequest`
- ✅ 到店商品搜索 `SearchDealsRequest`
- ✅ 分销取链 `LinksRequest`
- ✅ 异常订单数据 `OrdersAbnormalRequest`
- ✅ CPA订单数据 `OrdersCPARequest`
- ✅ CPS订单数据 `OrdersCPSRequest`
- ✅ 秒杀场次 `SeckillShowInfoRequest`
- ✅ 秒杀团单列表 `SeckillListRequest`
- 🆕 其他暂未支持，接下来会支持完善到店模块接口

使用
--

[](#使用)

### 获取某个省份的城市列表

[](#获取某个省份的城市列表)

```
use GaoweiSpace\MeituanPubUnion\Api\Common\Request\CitiesRequest;
use GaoweiSpace\MeituanPubUnion\Http\Client;

$app_key    = 'xxxxxxxxxx';
$utm_source = 'xxxxxxxxxx';

// 实例化获取城市的请求类
$request = new CitiesRequest();
// 设置省份ID
$request->setProvinceId(1);

// 实例客户端类
$client = new Client($app_key, $utm_source);

// 发送请求调用接口
$response = $client->syncInvoke($request);
```

### 请求参数

[](#请求参数)

> 请求参数的设置，请结合 [美团分销联盟API文档](https://pub.meituan.com/#/api-doc)，确认要使用的参数，调用对应请求API类的对应方法进行设置

每个请求API类中对于各个参数都已经内置了 `set` 前缀的设置方法，如：

```
public function setUtmSource(string $utmSource): void
{
    $this->utmSource = $utmSource;
}
```

调用对应方法，进行参数设置：

```
$request->setUtmSource('***');
```

### 在 Laravel 中使用

[](#在-laravel-中使用)

在 Laravel 中使用也是同样的安装方式，配置写在 `config/services.php` 中：

```
'meituan' => [
    'pub_union' => [
        'app_key'    => env('MEITUAN_PUB_UNION_APP_KEY'),
        'utm_source' => env('MEITUAN_PUB_UNION_UTM_SOURCE'),
    ]
]
```

然后在 .env 中配置：

```
MEITUAN_PUB_UNION_APP_KEY=xxxxxxxxxxxxxxxxxxxxx
MEITUAN_PUB_UNION_UTM_SOURCE=xxxxxxxxxxxxxxxxxxxxx

```

### 可以用两种方式来获取 `GaoweiSpace\MeituanPubUnion\Http\Client` 实例：

[](#可以用两种方式来获取-gaoweispacemeituanpubunionhttpclient-实例)

#### 方法参数注入

[](#方法参数注入)

```
use GaoweiSpace\MeituanPubUnion\Http\Client;

public function getCities(Client $client)
{
    $response = $client->syncInvoke($request);
}
```

#### 服务名访问

[](#服务名访问)

```
public function getCities()
{
    $response = app('MeituanPubUnion')->syncInvoke($request);
}
```

参考
--

[](#参考)

- [美团分销联盟API文档](https://pub.meituan.com/#/api-doc)

License
-------

[](#license)

MIT

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity45

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

3

Last Release

1427d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5353bed00e14559631181de22d0a5018d14df38b4f3e3d0d927f9de727234557?d=identicon)[JXLau](/maintainers/JXLau)

---

Top Contributors

[![JXLau](https://avatars.githubusercontent.com/u/30074374?v=4)](https://github.com/JXLau "JXLau (9 commits)")

### Embed Badge

![Health badge](/badges/jxlau-meituan-pub-union/health.svg)

```
[![Health](https://phpackages.com/badges/jxlau-meituan-pub-union/health.svg)](https://phpackages.com/packages/jxlau-meituan-pub-union)
```

###  Alternatives

[shlinkio/shlink

A self-hosted and PHP-based URL shortener application with CLI and REST interfaces

4.8k4.3k](/packages/shlinkio-shlink)[ralphjsmit/laravel-helpers

A package containing handy helpers for your Laravel-application.

13704.6k2](/packages/ralphjsmit-laravel-helpers)[dhlparcel/magento2-plugin

DHL Parcel plugin for Magento 2

11180.5k2](/packages/dhlparcel-magento2-plugin)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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