PHP code example of imactool / gjpzyx

1. Go to this page and download the library: Download imactool/gjpzyx 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/ */

    

imactool / gjpzyx example snippets



use Imactool\Gjpzyx\Factory;

$config = [
    'debug'=>false, //是否在测试环境下测试,线上必须设置 false
    'appKey' 	=> '',
    'appSecret' => '',
    'signKey'   => '',
    'token'		=> '',
    'shopKey'	=> '',
    //公司名称
    'CompanyName'=>'',
    //用户名
    'UserId'	=> '',
    //密码
    'Password'	=> '',
    'refreshToken' => '',
    //线上登录获取授权认证码的地址
    'loginUrl'=>'',
    //线上接口调用的地址
    'apiUrl'=>'http://ca.mygjp.com:8002/api/', //注意,需要 / 结尾
    //线上章鱼侠云erp登录地址
    'onlineLoginUrl'=>''
];
 
$app = Factory::Gjp($config);
如果是章鱼侠ERP
$app = Factory::Zyx($config);
其他调用方式都是一模一样


$parsm = [
    'numid'=>'324324324324',
    'ktypeids'=>[154274961429839227,154274961429839299],
    'iscalcsaleqty'=>true,
    'pagesize'=>100,
    'pageno' => 1
];
$productquery = $app->querySaleQty($parsm);



$storeArr = [
	'Id' =>1,
	'storecode'=>'sdf',
	'storename'=>'测试',
	'storetype'=>3,
	'image'=>'',
	'storephonenumber'=>'18355522221',
	'storeaddress'=>'门店地址'
];

$store = $app->pushStoreInfo($storeArr);


$refundOrder = [
	'refundnumber' =>'1154654656151',
	'tradeid'=>'123123151561561',
	'refundcreatetime'=>'2017-07-11 11:11:11',
	'refundtype'=>0,
	'refundstatus'=>1,
	'oid'=>'2345446546',
	'qty'=>1,
    'refundfee'=>100,
    //...其他参数
];

$result = $app->pushOrderRefund($refundOrder);