BrandData.php 1.22 KB
<?php
namespace LibModels\Wap\Category;

use Api\Yohobuy;
use Api\Sign;

/**
 * 品牌数据接口操作类
 * 
 * @name BrandData
 * @package Library/LibModels/wap/Category
 * @copyright yoho.inc
 * @version 1.0 (2015-10-10)
 * @author gtskk <rocky.zhang@yoho.cn>
 */
class BrandData
{
	/**
	 * 获取品牌数据
     * 
	 * @param integer $channel 是否,默认1表示是,传值为空是app中用于品牌搜索的数据
     * 
	 * @return array 品牌数据
	 */
    public static function getBrandsData($channel = 1)
    {
		// 构建必传参数
		$param = Yohobuy::param();

        $param['method'] = 'app.brand.brandlist';
		$param['yh_channel'] = $channel;
        $param['client_secret'] = Sign::getSign($param);
        
        return Yohobuy::get(Yohobuy::API_URL, $param);
    }

    /**
     * 获取品牌页顶部楼层数据
     * 
     * @return array 品牌也顶部楼层数据
     */
    public static function getBrandTopData()
    {
    	// 构建必传参数
		$param = Yohobuy::param();

		$param['content_code'] = 'ce6ac059493ec26241a8cbe0bfa1b17a';
        $param['client_secret'] = Sign::getSign($param);
        
        return Yohobuy::get(Yohobuy::SERVICE_URL.'operations/api/v5/resource/get', $param);
    }
}