SideData.php 1.43 KB
<?php

namespace LibModels\Wap\Home;

use Api\Sign;
use Api\Yohobuy;

/**
 * 侧边栏的数据模型
 * 
 * @name SideData
 * @package LibModels/Wap/Home
 * @copyright yoho.inc
 * @version 1.0 (2015-10-13 17:42:27)
 * @author fei.hong <fei.hong@yoho.cn>
 */
class SideData
{

    const URI_LEFTNAV_ENTRANCE = 'operations/api/v5/entrance/getEntrance';
    const URI_LEFTNAV_CATEGORY = 'operations/api/v6/category/getCategory';

    /**
     * 左侧边栏的分类和图标数据
     * 
     * @return array
     */
    public static function leftNav()
    {
//        $param = Yohobuy::param();
//        $param['client_type'] = 'h5'; // 因安卓不返回icon的地址
//        $param['client_secret'] = Sign::getSign($param);
//        $query = Yohobuy::httpBuildQuery('', $param);
//        
//        $urlList = array();
//        $urlList['getEntrance'] = Yohobuy::SERVICE_URL . self::URI_LEFTNAV_ENTRANCE . $query;
//        $urlList['getCategory'] = Yohobuy::SERVICE_URL . self::URI_LEFTNAV_CATEGORY . $query;
//        
//        return Yohobuy::getMulti($urlList);

        $param = Yohobuy::param();
        $param['client_type'] = 'h5'; // 调用H5手机网站的
        $param['private_key'] = 'fd4ad5fcfa0de589ef238c0e7331b585'; // 调用Android的private_key不然会有参数验证错误的bug
        $param['client_secret'] = Sign::getSign($param);

        return Yohobuy::get(Yohobuy::SERVICE_URL . self::URI_LEFTNAV_CATEGORY, $param);
    }

}