Prod.class.php 3.38 KB
<?php

/**
 *  prod信息
 *
 * @name Facade_Prod
 * @version 1.0 (2013-6-5)
 * @package Facade/Prod
 * @author hbomb
 * @since 1.0
 */

class Facade_Prod
{

    private static $service = null;
    /**
     * 返回service对象
     *
     * @return Service_Prod_Prod
     */
    public static function service()
    {
        if (null === self::$service)
        {
            self::$service = new Service_Prod();
        }
        return self::$service;
    }
    /**
     * 获取prod
     * 
     * @param int|array $recom_status
     * @param int $offset
     * @param int $limit
     * @return array
     */
    public static function getProd ($recom_status, $offset, $limit)
    {
        return self::service()->getProd($recom_status, $offset, $limit);
    }
    
    /**
     * 根据brand_id获取prod
     * 
     * @param string $offset
     * @param string $limit
     * @param string $brand_id
     * @param int|array $recom_status
     * @return array
     */
    public static function getProdByBrandId ($offset, $limit, $brand_id, $recom_status = 0)
    {
        return self::service()->getProdByBrandId($offset, $limit, $brand_id, $recom_status);
    }
    
    /**
     * 根据brand_id获取prod总数
     * 
     * @param string $brand_id
     * @param int|array $recom_status
     * @return array
     */
    public static function getProdTotalByBrandId($brand_id, $recom_status = 0)
    {
    	return self::service()->getProdTotalByBrandId($brand_id, $recom_status);
    }
    
    /**
     * 态获取所有prod个数. 用于前端分页
     * 
     * @param int|array $recom_status
     * @return int 
     */
    public static function getProdTotal ($recom_status)
    {
        return self::service()->getProdTotal($recom_status);
    }
    
    /**
     * 根据id更新prod操作.
     * 
     * @param string $name
     * @param string $brand_id
     * @param string $url
     * @param string $pic
     * @param string $text
     * @param int $sort
     * @param string $create_time
     * @param int $price
     * @param int $recom_status
     * @param string $market_price
     * @param string $product_skn
     * @param string $product_id
     * @param string $id
     * @return boolean
     */
    public static function updateProd ($name, $brand_id, $url, $pic, $text, $sort, $create_time, $price, $recom_status, $market_price, $product_skn, $product_id, $id)
    {
        return self::service()->updateProd($name, $brand_id, $url, $pic, $text, $sort, $create_time, $price, $recom_status, $market_price, $product_skn, $product_id, $id);
    }
    
    /**
     * 用户提交prod. 
     * 
     * @param string $name
     * @param string $brand_id
     * @param string $url
     * @param string $pic
     * @param string $text
     * @param int $sort
     * @param int $price
     * @param int $recom_status
     * @param string $market_price
     * @param string $product_skn
     * @param string $product_id
     * @return int
     */
    public static function submitProd ($name, $brand_id, $url, $pic, $text, $sort, $price, $recom_status, $market_price, $product_skn, $product_id)
    {
        return self::service()->submitProd($name, $brand_id, $url, $pic, $text, $sort, $price, $recom_status, $market_price, $product_skn, $product_id);
    }
    
    /**
     * 删除prod
     * @param unknown_type $id
     */
    public static function delProd($id)
    {
        return self::service()->delProd($id);
    }
}