DetailData.php 1.61 KB
<?php

namespace LibModels\Wap\Product;

use Api\Sign;
use Api\Yohobuy;

/**
 * 商品详情相关的数据模型
 * 
 * @name DetailData
 * @package LibModels/Wap/Product
 * @copyright yoho.inc
 * @version 1.0 (2015-10-8 11:51:32)
 * @author fei.hong <fei.hong@yoho.cn>
 */
class DetailData
{
    
    const PRODUCT_BASE_INFO = 'queryProductBasicInfo';
    const PRODUCT_GOODS_INFO = 'queryGoodsById';
    
    /**
     * 商品基本信息
     * 
     * @param int $productId
     * @return array
     */
    public function product($productId)
    {
        $result = array();
        
        if (is_numeric($productId)) {
            $result = Yohobuy::get(Yohobuy::API_URL_PRODUCTDETAIL . self::PRODUCT_BASE_INFO, array('productId' => $productId) );
        }
        
        return $result;
    }
    
    /**
     * 商品小图
     * 
     * @param int $goodsId
     * @return array
     */
    public function goods($goodsId)
    {
        $result = array();
        
        if (is_numeric($goodsId)) {
            $result = Yohobuy::get(Yohobuy::API_URL_PRODUCTDETAIL . self::PRODUCT_GOODS_INFO, array('goodsId' => $goodsId) );
        }
        
        return $result;
    }
    
    /**
     * 品牌
     * 
     * @param int $brandId
     * @return array
     */
    public function brand($brandId)
    {
        
    }
    
    /**
     * 库存
     * 
     * @param int $productId
     * @return int
     */
    public function storage($productId)
    {
        
    }
    
    /**
     * 尺码
     * 
     * @param int $productSkn
     * @return array
     */
    public function size($productSkn)
    {
        
    }
    
}