Authored by Rock Zhang

修复在线客服和帮助中心数据获取不到的bug

Code Review By Rock Zhang
... ... @@ -23,7 +23,7 @@ class HelpData
$param['method'] = 'app.help.li';
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::post(Yohobuy::API_URL, $param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
/*
... ...
... ... @@ -2,6 +2,7 @@
namespace LibModels\Wap\Home;
use Api\Sign;
use Api\Yohobuy;
/**
... ... @@ -20,23 +21,28 @@ class OnlineData
/*
* 获取帮助列表(分类),缓存1h
* clientType客户端
*/
public static function getOnlineServiceInfo($clientType = 'iphone')
public static function getOnlineServiceInfo()
{
return Yohobuy::get(Yohobuy::SERVICE_URL . self::ONLINE_URI . 'getCategory', array('client_type' => $clientType), 3600);
$params = Yohobuy::param();
$params['client_secret'] = Sign::getSign($params);
return Yohobuy::get(Yohobuy::SERVICE_URL . self::ONLINE_URI . 'getCategory', $params, 3600);
}
/*
* 获取问题详情,缓存1h
* cateId问题分类ID
* clientType客户端
*/
public static function getOnlineServiceDetail($cateId, $clientType = 'iphone')
public static function getOnlineServiceDetail($cateId)
{
return Yohobuy::get(Yohobuy::SERVICE_URL . self::ONLINE_URI . 'getHelp', array('category_id' => $cateId, 'client_type' => $clientType), 3600);
$params = Yohobuy::param();
$params['category_id'] = $cateId;
$params['client_secret'] = Sign::getSign($params);
return Yohobuy::get(Yohobuy::SERVICE_URL . self::ONLINE_URI . 'getHelp', $params, 3600);
}
}
... ...
... ... @@ -12,13 +12,12 @@ class OnlineModel
{
/*
* 获取在线帮助分类
* $clientType客户端类型
*/
public static function getOnlineServiceInfo($clientType = 'iphone')
public static function getOnlineServiceInfo()
{
//调用接口获取数据
$res = OnlineData::getOnlineServiceInfo($clientType);
$res = OnlineData::getOnlineServiceInfo();
$question = array();
$tab = array();
if (isset($res['data'])) {
... ... @@ -60,16 +59,15 @@ class OnlineModel
/*
* 加载分类下的问题和解决方法
* cateId问题分类ID
* clientType客户端
*/
public static function getOnlineServiceDetail($cateId, $clinetType = 'iphone')
public static function getOnlineServiceDetail($cateId)
{
$result = array();
if (!$cateId) {
return $result;
}
$res = OnlineData::getOnlineServiceDetail($cateId, $clinetType);
$res = OnlineData::getOnlineServiceDetail($cateId);
if (isset($res['code']) && $res['code'] === 200) {
$questionInfo = $res['data'];
$list = array();
... ...