Onlinereg.class.php 5.58 KB
<?php
/**
 * 资讯业务处理
 *
 */
class Facade_Onlinereg
{
    //参展商
    const TYPE_ONLINE_EXHIBITOR = 0;
    //赞助商
    const TYPE_ONLINE_SPONSOR = 1;
    //媒体
    const TYPE_ONLINE_MEDIA = 2;
    //手册参展商
    const TYPE_ONLINE_DOWNLOAD_EXHIBITOR = 0;
    //手册媒体
    const TYPE_ONLINE_DOWNLOAD_MEDIA = 1;
    
    /**
     * 服务
     */
    private static $service = null;
    /**
     *
     * @return Service_Index
     */
    private static function service ()
    {
        if (! isset(self::$service))
        {
            self::$service = new Service_Onlinereg();
        }
        return self::$service;
    }
    
    /**
     * 设置商家信息
     * 
     * @param string $name
     * @param string $type
     * @param string $sex
     * @param int $brand_reg_type
     * @param int $is_enter_yohobuy
     * @param int $profession
     * @param string $product_type
     * @param string $country
     * @param string $city
     * @param string $company
     * @param string $contact
     * @param string $telphone
     * @param string $mobile
     * @param string $email
     * @param string $relation
     * @param string $website
     * @param string $introduction
     * @param int $is_3c
     * @param string $place
     * @param string $files
     * @param string $zipcode
     * @return int
     */
    public static function setSellerInfo($name, $type, $sex, $brand_reg_type, $is_enter_yohobuy, $profession, $product_type, $country, $city,
        $company, $contact, $telphone, $mobile, $email, $relation, $website, $introduction, $is_3c, $place, $files, $zipcode)
    {
        $file = '';
        if(is_array($files)) 
        {
            $file = implode('|', $files);
        } else {
            $file = $files;
        }
        return self::service()->setSellerInfo($name, $type, $sex, $brand_reg_type, $is_enter_yohobuy, $profession, $product_type, $country, $city,
        $company, $contact, $telphone, $mobile, $email, $relation, $website, $introduction, $is_3c, $place, $file, $zipcode);
    }
    
    /**
     * 获取商家列表
     * 
     * @param int $type
     * @param int $offset
     * @param int $limit
     * @return array
     */
    public static function getSellerListByType($type, $offset = 1, $limit = 10)
    {
        return self::service()->getSellerListByType($type, $offset, $limit);
    }
    
    /**
     * 根据type获取总数
     *
     * @param int $type
     * @return array
     */
    public static function getSellerTotalByType($type)
    {
        return self::service()->getSellerTotalByType($type);
    }
    
    /**
     * 根据ID获取商家
     *
     * @param int $id
     * @return array
     */
    public static function getSellerById($id)
    {
        return self::service()->getSellerById($id);
    }
    
    /**
     * 设置媒体信息
     *
     * @param string $name
     * @param string $profession
     * @param int $sex
     * @param string $company
     * @param string $introduction
     * @param string $website
     * @param string $city
     * @param string $email
     * @param string $mobile
     * @param string $telphone
     * @param string $address
     * @param string $zipcode
     * @return int
     */
    public static function setMediaInfo($name, $profession, $sex, $company, $introduction, $website, $city,
        $email, $mobile, $telphone, $address, $zipcode)
    {
        return self::service()->setMediaInfo($name, $profession, $sex, $company, $introduction, $website, $city,
        $email, $mobile, $telphone, $address, $zipcode);
    }
    
    
    /**
     * 获取下载列表
     *
     * @param int $type
     * @param int $offset
     * @param int $limit
     * @return array
     */
    public static function getDownloadListByType($type, $offset, $limit)
    {
        return self::service()->getDownloadListByType($type, $offset, $limit);
    }
    
    /**
     * 获取下载总数
     * 
     * @param int $type
     * @return array
     */
    public static function getDownloadTotalByType($type)
    {
        return self::service()->getDownloadTotalByType($type);
    }
    
    /**
     * 根据ID设置下载信息
     *
     * @param int $id
     * @param string $title
     * @param string $cover
     * @param string $file
     * @param string $source
     * @param string $source_link
     * @return boolean
     */
    public static function setDownloadInfoById($id, $title, $cover, $file, $source, $source_link)
    {
        return self::service()->setDownloadInfoById($id, $title, $cover, $file, $source, $source_link);
    }
    
    /**
     * 设置下载信息
     *
     * @param string $title
     * @param string $cover
     * @param string $file
     * @param string $source
     * @param string $source_link
     * @param string $type
     * @return boolean
     */
    public static function setDownloadInfo($title, $cover, $file, $source, $source_link, $type)
    {
        return self::service()->setDownloadInfo($title, $cover, $file, $source, $source_link, $type);
    }
    
    /**
     * 获取下载信息
     * 
     * @param int $id
     * @return array
     */
    public static function getDownloadById($id)
    {
        return self::service()->getDownloadById($id);
    }
    
    /**
     * 删除下载信息
     *
     * @param int $id
     * @return boolean
     */
    public static function delDownload($id)
    {
        return self::service()->delDownload($id);
    }
    
    /**
     * 设置商家信息
     * 
     * @param array $data
     * @return boolean
     */
    public static function setSeller(array $data)
    {
        return self::service()->setSeller($data);
    }
}