...
|
...
|
@@ -23,15 +23,9 @@ class Yohobuy |
|
|
// const YOHOBUY_URL = 'http://www.yohobuy.com/';
|
|
|
|
|
|
//java API
|
|
|
// const API_URL = 'http://apih5.yoho.cn/';
|
|
|
// const API_URL2 = 'http://apih5.yoho.cn/';
|
|
|
// const SERVICE_URL = 'http://serviceh5.yoho.cn/';
|
|
|
// const YOHOBUY_URL = 'http://www.yohobuy.com/';
|
|
|
// const API_OLD = 'http://api2.open.yohobuy.com/';
|
|
|
|
|
|
// const API_URL = 'http://api.yoho.cn/';
|
|
|
// const API_URL2 = 'http://api.yoho.cn/';
|
|
|
// const SERVICE_URL = 'http://service.yoho.cn/';
|
|
|
// const API_URL = 'http://api.yoho.yohoops.org/';
|
|
|
// const API_URL2 = 'http://api.yoho.yohoops.org/';
|
|
|
// const SERVICE_URL = 'http://service.yoho.yohoops.org/';
|
|
|
// const YOHOBUY_URL = 'http://www.yohobuy.com/';
|
|
|
// const API_OLD = 'http://api2.open.yohobuy.com/';
|
|
|
|
...
|
...
|
@@ -43,18 +37,15 @@ class Yohobuy |
|
|
// const API_OLD = 'http://api2.open.yohobuy.com/';
|
|
|
|
|
|
/* 测试环境 java API*/
|
|
|
const API_URL = 'http://testapi.yoho.cn:28078/'; // 'http://devapi.yoho.cn:58078/';
|
|
|
// const API_URL = 'http://devapi.yoho.cn:58078/';
|
|
|
const DEV_API_URL = 'http://devapi.yoho.cn:58078/';
|
|
|
const SERVICE_URL = 'http://testservice.yoho.cn:28077/'; // 'http://devservice.yoho.cn:58077/';
|
|
|
const DEV_SERVICE_URL = 'http://devservice.yoho.cn:58077/';
|
|
|
const PRD_SERVICE_URL = 'http://serviceh5.yoho.cn/';
|
|
|
const API_URL = 'http://testapi.yoho.cn:28078/'; // 'http://192.168.102.205:8080/gateway/'
|
|
|
const SERVICE_URL = 'http://testservice.yoho.cn:28077/';
|
|
|
const YOHOBUY_URL = 'http://www.yohobuy.com/';
|
|
|
const API_OLD = 'http://test2.open.yohobuy.com/';
|
|
|
|
|
|
/* 测试环境 php API*/
|
|
|
// const API_URL = 'http://test2.open.yohobuy.com/';
|
|
|
// const SERVICE_URL = 'http://test.service.api.yohobuy.com/';
|
|
|
/* 预览环境 */
|
|
|
// const API_URL = 'http://preapi.yoho.cn/';
|
|
|
// const API_URL2 = 'http://preapi.yoho.cn/';
|
|
|
// const SERVICE_URL = 'http://preservice.yoho.cn/';
|
|
|
// const YOHOBUY_URL = 'http://www.yohobuy.com/';
|
|
|
// const API_OLD = 'http://api2.open.yohobuy.com/';
|
|
|
|
...
|
...
|
@@ -78,7 +69,6 @@ class Yohobuy |
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 取得当前的客户端类型
|
|
|
*/
|
...
|
...
|
@@ -87,15 +77,12 @@ class Yohobuy |
|
|
// 苹果设备
|
|
|
if (strstr($_SERVER['HTTP_USER_AGENT'], 'iPhone')) {
|
|
|
return 'iphone';
|
|
|
}
|
|
|
// 苹果IPAD
|
|
|
} // 苹果IPAD
|
|
|
elseif (strstr($_SERVER['HTTP_USER_AGENT'], 'iPad')) {
|
|
|
return 'ipad';
|
|
|
}
|
|
|
elseif (stristr($_SERVER['HTTP_USER_AGENT'], 'android')) {
|
|
|
} elseif (stristr($_SERVER['HTTP_USER_AGENT'], 'android')) {
|
|
|
return 'android';
|
|
|
}
|
|
|
// 其它
|
|
|
} // 其它
|
|
|
else {
|
|
|
return 'android';
|
|
|
}
|
...
|
...
|
@@ -213,8 +200,7 @@ class Yohobuy |
|
|
// 接口调用异常时, 不害怕,从我们的二级缓存(slave)里再取数据.
|
|
|
if (empty($result)) {
|
|
|
$result = Cache::get($url, 'slave');
|
|
|
}
|
|
|
// 接口调用成功时,这里会设置一级(master)和二级(slave)的缓存数据.
|
|
|
} // 接口调用成功时,这里会设置一级(master)和二级(slave)的缓存数据.
|
|
|
else {
|
|
|
Cache::set($url, $result, $cache);
|
|
|
}
|
...
|
...
|
@@ -354,13 +340,12 @@ class Yohobuy |
|
|
}
|
|
|
|
|
|
$response = json_decode($data, true);
|
|
|
if(!$isOriginalData) {//只返回data数据
|
|
|
if (!$isOriginalData) {//只返回data数据
|
|
|
if (!isset($response['data'])) {
|
|
|
continue;
|
|
|
}
|
|
|
$result[$name] = $response['data'];
|
|
|
}
|
|
|
else {
|
|
|
} else {
|
|
|
$result[$name] = $response;
|
|
|
}
|
|
|
curl_multi_remove_handle($mh, $ch[$name]);
|
...
|
...
|
@@ -373,8 +358,7 @@ class Yohobuy |
|
|
// 接口调用异常时, 不害怕,从我们的二级缓存(slave)里再取数据.
|
|
|
if (empty($result[$name])) {
|
|
|
$result = Cache::get($key, 'slave');
|
|
|
}
|
|
|
// 接口调用成功时,这里会设置一级(master)和二级(slave)的缓存数据.
|
|
|
} // 接口调用成功时,这里会设置一级(master)和二级(slave)的缓存数据.
|
|
|
else {
|
|
|
Cache::set($key, $result, $cache);
|
|
|
}
|
...
|
...
|
@@ -422,8 +406,7 @@ class Yohobuy |
|
|
// 接口调用异常时, 不害怕,从我们的二级缓存(slave)里再取数据.
|
|
|
if (empty($result)) {
|
|
|
$result = Cache::get($key, 'slave');
|
|
|
}
|
|
|
// 接口调用成功时,这里会设置一级(master)和二级(slave)的缓存数据.
|
|
|
} // 接口调用成功时,这里会设置一级(master)和二级(slave)的缓存数据.
|
|
|
else {
|
|
|
Cache::set($key, $result, $cache);
|
|
|
}
|
...
|
...
|
|