SideData.php 1.33 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/v5/category/getCategory';
    
    /**
     * 左侧边栏的分类和图标数据
     * 
     * 备注:暂不使用,因很少变,获取后还需要再封装
     * 
     * @return array
     */
    public static function leftNav()
    {
        $param = Yohobuy::param();
        $param['client_type'] = 'iphone'; // 因安卓不返回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_secret'] = Sign::getSign($param);
//        
//        return Yohobuy::get(Yohobuy::SERVICE_URL . self::URI_LEFTNAV_CATEGORY, $param);
    }
    
}