Commit 5b9a1cd1 by 朱继来

调整自营预售库存链接

parent 093cfe95
Showing with 11 additions and 4 deletions
......@@ -252,13 +252,20 @@ function getSelfStock($goods_id)
{
if (!$goods_id) return '商品ID不存在';
$url = Config('website.self-stock-url');
$data['sku_id'] = $goods_id;
// $url = Config('website.self-stock-url');
// $data['sku_id'] = $goods_id;
// $response = json_decode(curlApi($url, $data, 'POST'), true);
$url = Config('website.search-skuid');
$data['id'] = $goods_id;
$data['k1'] = time();
$data['k2'] = md5(md5($data['k1']).'fh6y5t4rr351d2c3bryi');
$response = json_decode(curlApi($url, $data, 'POST'), true);
if ($response['errcode'] == 0) {
return isset($response['data'][$goods_id]['stock']) ? $response['data'][$goods_id]['stock'] : 0;
if ($response['err_code'] == 0) {
return $response['data']['goods_number'] ? $response['data']['goods_number'] : 0;
} else {
return '未找SKU信息';
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment