OnlineData.php 1.03 KB
<?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);
    }

}