PHPackages                             lyhiving/guanyierp - 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. lyhiving/guanyierp

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

lyhiving/guanyierp
==================

Guanyi ERP PHP SDK

1.1.3(4y ago)570MITPHPPHP &gt;=5.4

Since Apr 22Pushed 4y ago1 watchersCompare

[ Source](https://github.com/lyhiving/guanyierp)[ Packagist](https://packagist.org/packages/lyhiving/guanyierp)[ Docs](https://github.com/lyhiving/guanyierp)[ RSS](/packages/lyhiving-guanyierp/feed)WikiDiscussions master Synced today

READMEChangelog (8)DependenciesVersions (9)Used By (0)

管易ERP
-----

[](#管易erp)

管易云PHP SDK。

安装
--

[](#安装)

使用 Composer

```
composer require lyhiving/guanyierp
```

或直接在composer.json 添加

```
{
    "require": {
            "lyhiving/guanyierp": "1.*"
    }
}
```

用法
--

[](#用法)

### 初始化

[](#初始化)

请通过 [后台](http://v2.guanyierp.com/index)-&gt;控制面板-&gt;应用授权-&gt;云ERP授权 获取对应。

```
use lyhiving\guanyierp\guanyierp;

$config = [
    'appkey' =>  '[APPKEY]',
    'secret' =>  '[SECRET]',
    'sessionkey' =>  '[SESSIONKEY]'
];

$erp = new guanyierp($config);
```

### 通用获取方法getTo：

[](#通用获取方法getto)

//获取方法，具体看[接口文档](http://support.guanyierp.com/hc/kb/category/1005768/)

```
$method='gy.erp.shop.get';
$data =[];
$filed ='shops';
$result = $erp->getTo($method, $data, $filed);
```

### 常见变量的获取：

[](#常见变量的获取)

```
$error = $erp->error(); //出错信息，为否时表示无出错
$errno = $erp->error(true); //出错代号

$total = $erp->total; //条目总数，一般出现在请求列表
$orgi = $this->get('orgi'); //原始的返回内容
```

### 获取店铺信息：

[](#获取店铺信息)

方法：*gy.erp.shop.get*

[说明地址](http://support.guanyierp.com/hc/kb/article/1234935/)

```
$data=[];
$data['page_no'] = '1';
$data['page_size'] = '10';
$result = $erp->getShop($data);
```

其他常用的方法
-------

[](#其他常用的方法)

### 供应商查询：

[](#供应商查询)

方法：*gy.erp.supplier.get*

[说明地址](http://support.guanyierp.com/hc/kb/article/1234935/)

`里面提到的返回字段supplier是错的，实际上是supplier_list。`

```
$data=[];
$data['page_no'] = '1';
$data['page_size'] = '10';
$result = $erp->getShop($data);
```

### 会员信息查询：

[](#会员信息查询)

方法：*gy.erp.vip.get*

[说明地址](http://support.guanyierp.com/hc/kb/article/1234990/)

`里面提到的返回字段vip是错的，实际上是vips。有见及此，使用本Class应该尽量通过getTo的方法进行`

```
$data=[];
$data['page_no'] = '1';
$data['page_size'] = '10';
$result = $erp->getShop($data);
```

### 库存信息查询：

[](#库存信息查询)

方法：*gy.erp.new.stock.get*

[说明地址](http://support.guanyierp.com/hc/kb/article/1235063/)

```
$data=[];
$data['page_no'] = 1;
$data['page_size'] = 1;
$data['item_code'] = 201495;
$data['warehouse_code'] = 110;
$result = $erp->getStock($data);
```

### 获取单商品在指定仓库的库存：

[](#获取单商品在指定仓库的库存)

```
$result = $erp->getItemStock(201495,110);
```

### 设置指定仓库某个商品库存：

[](#设置指定仓库某个商品库存)

方法：*gy.erp.stock.count.add*

[说明地址](http://support.guanyierp.com/hc/kb/article/1235058/)

```
$note = 'Test setItemStock for demo test';
$warehouse_code = 110;
$item_code = 201495;
$qry = 68;
$result = $erp->setItemStock($warehouse_code, $item_code, $qry, $note);
```

如果需要一次设置多个商品库存，直接将$item\_code 换成数组。如：

```
$note = 'Test setItemStock for demo test';
$warehouse_code = 110;
$items = [
    [
        'item_code' => 201497,
        'qty'   => 12
    ],
    [
        'item_code' => 201491,
        'qty'   => 33
    ]
];
$result = $erp->setItemStock($warehouse_code, $items, null, 'Test setItemStock for batch test');
```

###  Health Score

26

—

LowBetter than 46% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity52

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

Recently: every ~5 days

Total

8

Last Release

1596d ago

### Community

Maintainers

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

---

Top Contributors

[![lyhiving](https://avatars.githubusercontent.com/u/70043?v=4)](https://github.com/lyhiving "lyhiving (5 commits)")

---

Tags

ERPGuanyi

### Embed Badge

![Health badge](/badges/lyhiving-guanyierp/health.svg)

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

###  Alternatives

[hubleto/erp

Business Application Hub. Opensource ERP and CRM.

331.3k2](/packages/hubleto-erp)[zmoyi/jstan

聚水潭-php-sdk

153.8k](/packages/zmoyi-jstan)

PHPackages © 2026

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