PHP code example of yangxmo / hyperf-stbz-supply

1. Go to this page and download the library: Download yangxmo/hyperf-stbz-supply library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

yangxmo / hyperf-stbz-supply example snippets


        $obj = new \Xmo\Api\SupplyClient(['page'=>1]);
        $obj->setAppkey('你的appkey');
        $obj->setAppsecret('你的秘钥');
        $res =$obj->order->setApi('文档中的API地址')->get(); //api 就是聚合文档中的
        var_dump($res);




namespace App\Services\ApiOpen;


class AliOpen extends \Xmo\Api\SupplyClient
{
    public function __construct($params = array())
    {
        $this->setAppkey('39376**');
        $this->setAppsecret('0RsvFZYV**');
        parent::__construct($params);
    }
}


        $get_data =( new  \Xmo\Api\SupplyClient([
            'page'=>1,
            'limit'=>100,
        ]))
            ->order
            ->setApi('/v2/Goods/Lists')
            ->get();

        $orderSn = '20191115204845294762_6_1_1';
    
        $get_data = (new \Xmo\Aapi\SupplyClient([]))
            ->order
            ->setApi("/v2/order/".$orderSn)
            ->get();