PHPackages                             wengoooo/yituo - 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. wengoooo/yituo

ActiveLibrary

wengoooo/yituo
==============

v1.1.1(6y ago)037MITPHPPHP &gt;7.0

Since Aug 20Pushed 6y ago1 watchersCompare

[ Source](https://github.com/wwwenge/yituo)[ Packagist](https://packagist.org/packages/wengoooo/yituo)[ RSS](/packages/wengoooo-yituo/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (1)Dependencies (5)Versions (13)Used By (0)

安装
==

[](#安装)

环境要求
----

[](#环境要求)

> - PHP &gt;= 7.0
> - [PHP cURL 扩展](http://php.net/manual/en/book.curl.php)
> - [PHP OpenSSL 扩展](http://php.net/manual/en/book.openssl.php)
> - [PHP fileinfo 拓展](http://php.net/manual/en/book.fileinfo.php)

安装
--

[](#安装-1)

使用 [composer](http://getcomposer.org/):

```
$ composer require wengoooo/yituo
```

快速开始
----

[](#快速开始)

> 配置

```
require_once('vendor/autoload.php');
use Symfony\Component\Cache\Adapter\RedisAdapter;

$config = [
    'client_id' => 'xxxxxxxxxxxxxxxxxxxxxxx',
    'client_secret' => 'xxxxxxxxxxxxxxxxxxxxxxxx',
    'response_type' => 'array',
    'oauth' => [
        'redirect_uri' => $redirect_uri, # 验证跳转uri
        'username' => $username, # 商店登录名
        'password' => $password, # 商店登录密码
        'shop_name' => '19pop' # 商店名字
    ],
    'http' => [
        'max_retries' => 3,
        'retry_delay' => 500,
        'timeout' => 60,
        'debug' => true,
        'base_uri' => 'https://api.thebase.in/',
    ],
];

// 创建 redis 实例
$redis = new Redis();
$redis->connect('127.0.0.1', 6379);

$app = Yituo\Factory::TheBase($config);
// 创建缓存实例
$cache = new RedisAdapter($redis);
// 替换缓存
$app->rebind('cache', $cache);
```

> 初始化Access Token

```
$app->oauth->initializeToken();
```

> 获取用户信息

```
print_r($app->user->getUser());
```

> 目录操作

```
$app->category->getCategories();
$app->category->editCategory($category_id);
$app->category->deleteCategory($category_id);
```

> Item操作

```
$app->items->getItems(['limit' => 5]);
$app->items->search($keyword);
$app->items->getItem($item_id);
$app->items->addItem($title, $price, $stock);
$app->items->editItem($item_id);
$app->items->deleteItem($item_id);
$app->items->addImage($item_id, $image_no, $image_url);
$app->items->deleteImage($item_id, $image_no);
$app->items->editStock($item_id, $stock, $variation_id, $variation_stock);
$app->items->deleteVariation($item_id, $variation_id);
```

> item to categories操作

```
$app->item_categories->getItemToCagegories($item_id);
$app->item_categories->addItemToCagegories($item_id);
$app->item_categories->deleteItemToCagegories($item_category_id);
```

> orders操作

```
$app->order->getOrders();
$app->order->getOrderDetail($uniqueKey);
$app->order->updateOrder($order_item_id, $status, $add_comment, $atobarai_status, $delivery_company_id, $tracking_number);
```

并发请求
----

[](#并发请求)

> categories操作

```
$app->mulit_categories->addCategories([['name' => 'bbb','parent_id' => '0'], ['name' => 'cccc','parent_id' => '0']]);
$app->mulit_categories->deleteCategories[['id' => "1921361"], ['id' => "1921361"]]);
var_dump($app->mulit_categories->getCategories());
print_r($app->mulit_categories->sortCategories([
    [ 'id' => 1941924,
      'list_order' => 1,
      'children' => [
            ['id' => 1941927, 'list_order' => 1],
            ['id' => 1941928, 'list_order' => 2]
      ]
     ],
     [ 'id' => 1941925,
       'list_order' => 2,
       'children' => [
                 ['id' => 1941929, 'list_order' => 1],
                 ['id' => 1941930, 'list_order' => 2]
       ]
     ],
     [ 'id' => 1941926,
       'list_order' => 3
     ]
  ]
));
```

> items操作

```
var_dump($app->mulit_items->getIds());
var_dump($app->mulit_items->getItems([['item_id' => '23124163'], ['item_id' => '23124163']]));
$app->mulit_items->getItems([['item_id' => '23124163'], ['item_id' => '23124163']], function(GuzzleHttp\Psr7\Response $response, $index) {
    var_dump((string)$response->getBody());
});
print_r($app->mulit_items->getAvailableIds());
print_r($app->mulit_items->createItemIds(100));
print_r($app->mulit_items->searchItems('fakeproduct'));
$app->mulit_items->sortItems(['item_ids' => ["23120451", "23061078", "23086207", "23086212", "23085510"]]);
$app->mulit_items->deleteItems(['item_ids' => ["23123894", "23120451"]]);
var_dump($app->mulit_items->uploadImages(['H:/2.jpg', 'H:/3.jpg']));

$app->mulit_items->addItems([array (
    'item' =>
        array (
            'variations' =>
                array (
                    0 =>
                        array (
                            'id' => '',
                            'name' => 'ブラック/M',
                            'stock' => '1000',
                        ),
                    1 =>
                        array (
                            'id' => '',
                            'name' => 'ブラック/L',
                            'stock' => '1000',
                        ),
                ),
            'visible' => true,
            'stock' => 0,
            'price' => '1111',
            'update_price' => NULL,
            'item_tax_type' => 'standard',
            'detail' => '',
            'images' =>
                array (
                ),
            'name' => 'MulitTest6',
            'top_of_list' => true,
            'apps' =>
                array (
                    'category' =>
                        array (
                            'enabled' =>
                                array (
                                    0 =>
                                        array (
                                            'id' => '1921179',
                                            'parents' =>
                                                array (
                                                ),
                                        ),
                                ),
                        ),
                    'label' =>
                        array (
                        ),
                    'quantity_limit' =>
                        array (
                        ),
                    'sale' =>
                        array (
                            'discount_rate' => 0,
                        ),
                    'shipping_fee' =>
                        array (
                            'enabled' =>
                                array (
                                ),
                        ),
                    'subscription' =>
                        array (
                        ),
                    'digital' =>
                        array (
                        ),
                    'club_t' =>
                        array (
                        ),
                    'sp_case' =>
                        array (
                        ),
                    'sales_period' =>
                        array (
                        ),
                    'pre_order' =>
                        array (
                        ),
                ),
        ),
), array (
    'item' =>
        array (
            'variations' =>
                array (
                    0 =>
                        array (
                            'id' => '',
                            'name' => 'ブラック/M',
                            'stock' => '1000',
                        ),
                    1 =>
                        array (
                            'id' => '',
                            'name' => 'ブラック/L',
                            'stock' => '1000',
                        ),
                ),
            'visible' => true,
            'stock' => 0,
            'price' => '1111',
            'update_price' => NULL,
            'item_tax_type' => 'standard',
            'detail' => '',
            'images' =>
                array (
                ),
            'name' => 'MulitTest7',
            'top_of_list' => true,
            'apps' =>
                array (
                    'category' =>
                        array (
                            'enabled' =>
                                array (
                                    0 =>
                                        array (
                                            'id' => '1921179',
                                            'parents' =>
                                                array (
                                                ),
                                        ),
                                ),
                        ),
                    'label' =>
                        array (
                        ),
                    'quantity_limit' =>
                        array (
                        ),
                    'sale' =>
                        array (
                            'discount_rate' => 0,
                        ),
                    'shipping_fee' =>
                        array (
                            'enabled' =>
                                array (
                                ),
                        ),
                    'subscription' =>
                        array (
                        ),
                    'digital' =>
                        array (
                        ),
                    'club_t' =>
                        array (
                        ),
                    'sp_case' =>
                        array (
                        ),
                    'sales_period' =>
                        array (
                        ),
                    'pre_order' =>
                        array (
                        ),
                ),
        ),
)]);

$app->mulit_items->editItems([array (
    'item_id' => '23124163',
    'item' =>
        array (
            'variations' =>
                array (
                    0 =>
                        array (
                            'id' => '',
                            'name' => 'ブラック/XL',
                            'stock' => '1000',
                        ),
                    1 =>
                        array (
                            'id' => '',
                            'name' => 'ブラック/L',
                            'stock' => '1000',
                        ),
                ),
            'visible' => true,
            'stock' => 0,
            'price' => '1111',
            'update_price' => NULL,
            'item_tax_type' => 'standard',
            'detail' => '',
            'images' =>
                array (
                ),
            'name' => 'MulitTest6',
            'top_of_list' => true,
            'apps' =>
                array (
                    'category' =>
                        array (
                            'enabled' =>
                                array (
                                    0 =>
                                        array (
                                            'id' => '1921179',
                                            'parents' =>
                                                array (
                                                ),
                                        ),
                                ),
                        ),
                    'label' =>
                        array (
                        ),
                    'quantity_limit' =>
                        array (
                        ),
                    'sale' =>
                        array (
                            'discount_rate' => 0,
                        ),
                    'shipping_fee' =>
                        array (
                            'enabled' =>
                                array (
                                ),
                        ),
                    'subscription' =>
                        array (
                        ),
                    'digital' =>
                        array (
                        ),
                    'club_t' =>
                        array (
                        ),
                    'sp_case' =>
                        array (
                        ),
                    'sales_period' =>
                        array (
                        ),
                    'pre_order' =>
                        array (
                        ),
                ),
        ),
), array (
    'item_id' => '23124164',
    'item' =>
        array (
            'variations' =>
                array (
                    0 =>
                        array (
                            'id' => '',
                            'name' => 'ブラック/M',
                            'stock' => '1000',
                        ),
                    1 =>
                        array (
                            'id' => '',
                            'name' => 'ブラック/L',
                            'stock' => '1000',
                        ),
                ),
            'visible' => true,
            'stock' => 0,
            'price' => '1111',
            'update_price' => NULL,
            'item_tax_type' => 'standard',
            'detail' => '',
            'images' =>
                array (
                ),
            'name' => 'MulitTest7',
            'top_of_list' => true,
            'apps' =>
                array (
                    'category' =>
                        array (
                            'enabled' =>
                                array (
                                    0 =>
                                        array (
                                            'id' => '1921179',
                                            'parents' =>
                                                array (
                                                ),
                                        ),
                                ),
                        ),
                    'label' =>
                        array (
                        ),
                    'quantity_limit' =>
                        array (
                        ),
                    'sale' =>
                        array (
                            'discount_rate' => 0,
                        ),
                    'shipping_fee' =>
                        array (
                            'enabled' =>
                                array (
                                ),
                        ),
                    'subscription' =>
                        array (
                        ),
                    'digital' =>
                        array (
                        ),
                    'club_t' =>
                        array (
                        ),
                    'sp_case' =>
                        array (
                        ),
                    'sales_period' =>
                        array (
                        ),
                    'pre_order' =>
                        array (
                        ),
                ),
        ),
)]);
```

> orders操作

```
var_dump($app->mulit_orders->getOrdersId(['limit' => 50,
        'words' => "",
        'order_by' => "ordered_desc",
        'status' => [],
        'payment' => [],
        'order_type' => 'all'
        ]));
var_dump($app->mulit_orders->getOrders(['unique_keys' => ['0B14AF0F2EEC413C']]));
```

图片对比
----

[](#图片对比)

> 添加图片到图库, 添加

```
# brief参数是用来配合自己系统的参考数据的
# 成功后会返回一个cont_sign，这个是唯一值，用来删除或者更新,要保存起来
var_dump($app->images_search_client->addSameHq([
    ['image' => base64_encode(file_get_contents('H:/web/opencart/image/catalog/demo/canon_eos_5d_1.jpg')), 'brief' => json_encode(["id" => "1234", "name" => "acde"])],
    ['image' => base64_encode(file_get_contents('H:/web/opencart/image/catalog/demo/2.jpg')), 'brief' => json_encode(["id" => "1234", "name" => "acde"])]
]));
```

> 查找相同的图片

```
var_dump($app->images_search_client->searchSameHq([
    ['image' => base64_encode(file_get_contents('D:/7.jpg'))],
    ['image' => base64_encode(file_get_contents('D:/2.jpg'))],
]));
```

> 删除图片

```
#删除多个图片，用;分割
var_dump($app->images_search_client->deleteSameHq(['4053743853,3180309171;3053743853,3180329171']));
```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 72.2% 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 ~13 days

Recently: every ~26 days

Total

12

Last Release

2316d ago

Major Versions

v0.9 → v1.02019-11-08

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1544682?v=4)[Wengo Team Web](/maintainers/wengo)[@Wengo](https://github.com/Wengo)

---

Top Contributors

[![wengoooooooo](https://avatars.githubusercontent.com/u/26360605?v=4)](https://github.com/wengoooooooo "wengoooooooo (13 commits)")[![wwwenge](https://avatars.githubusercontent.com/u/26360403?v=4)](https://github.com/wwwenge "wwwenge (5 commits)")

### Embed Badge

![Health badge](/badges/wengoooo-yituo/health.svg)

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

###  Alternatives

[tempest/framework

The PHP framework that gets out of your way.

2.1k23.1k9](/packages/tempest-framework)[concrete5/core

Concrete core subtree split

19159.3k48](/packages/concrete5-core)

PHPackages © 2026

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