HelpData.php 1.61 KB
<?php

namespace LibModels\Web\Home;

use Api\Yohobuy;
use Api\Sign;

class HelpData
{

    /**
     * 查询帮助列表分类
     * @return type
     */
    public static function getHelpCategory()
    {
        $param = Yohobuy::param();
        $param['method'] = 'web.help.category';

        $param['client_secret'] = Sign::getSign($param);

        return Yohobuy::get(Yohobuy::API_URL, $param);
    }

    /**
     * 查看问题详情
     * @param type $cateId
     * @param type $page
     * @param type $limit
     * @return type
     */
    public static function getHelpDetail($cateId, $page = 1, $limit = 10, $problem = '')
    {
        $param = Yohobuy::param();
        $param['method'] = 'web.help.getHelpDetailList';
        $param['category_id'] = $cateId;
        $param['page'] = $page;
        $param['limit'] = $limit;
        if ($problem) {
            $param['problem'] = $problem;
        }
        $param['client_secret'] = Sign::getSign($param);

        return Yohobuy::get(Yohobuy::API_URL, $param);
    }

    /**
     * 获取常见问题
     * @param type $cateId
     * @param type $problem 检索关键字
     * @return type
     */
    public static function getCommonFaqLimit($cateId, $problem = '')
    {
        $param = Yohobuy::param();
        $param['method'] = 'web.help.getCommonFaqList';
        $param['category_id'] = $cateId;
        if ($problem) {
            $param['problem'] = $problem;
        }
        $param['client_secret'] = Sign::getSign($param);

        return Yohobuy::get(Yohobuy::API_URL, $param);
    }

}