OnlineData.php
1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php
namespace LibModels\Wap\Home;
use Api\Sign;
use Api\Yohobuy;
/**
* 在线客服数据模型
*
* @name OnlineData
* @package LibModels/Wap/Home
* @copyright yoho.inc
* @version 1.0 (2015-11-13)
* @author xiaowei
*/
class OnlineData
{
const ONLINE_URI = 'operations/api/v1/help/';
/*
* 获取帮助列表(分类),缓存1h
*/
public static function getOnlineServiceInfo()
{
$params = Yohobuy::param();
$params['client_secret'] = Sign::getSign($params);
return Yohobuy::get(Yohobuy::SERVICE_URL . self::ONLINE_URI . 'getCategory', $params, 3600);
}
/*
* 获取问题详情,缓存1h
* cateId问题分类ID
*/
public static function getOnlineServiceDetail($cateId)
{
$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);
}
}