首页 销售车型全车件查询 销售车型全车件查询示例代码 按分组查配件[PHP]

按分组查配件示例代码[PHP]

作者: 阅读数:1357 上传时间:2021-06-16

按分组查配件

<?php

require_once 'curl.func.php';

$appkey = 'your_appkey_here';//你的appkey
$classid = '466';
$carid = '66602';
$vin = '';
$url = "https://api.jisuapi.com/epc2/parts?appkey=$appkey&classid=$classid&carid=$carid&vin=$vin";
$result = curlOpen($url, ['ssl'=>true]);

$jsonarr = json_decode($result, true);
//exit(var_dump($jsonarr));

if($jsonarr['status'] != 0)
{
    echo $jsonarr['msg'];
    exit();
}

$result = $jsonarr['result'];
echo $result['vin'];
foreach($result['list'] as $key=>$val)
{
	echo $val['0'].' '.$val['partsid'].' '.$val['name'].' '.$val['number'].' '.$val['price'].' '.$val['remark'].' '.$val['marketprice'];
}