New.php 2.93 KB
<?php

namespace Product;

use LibModels\Web\Product\SearchData;
use WebPlugin\HelperSearch;
use Product\SearchModel;
use Api\Yohobuy;

/**
 * sale首页模板数据模型
 *
 */
class NewModel 
{

    public static function getNewSearchData($customCondition, $customOptions) 
    {
        $urlList = array();
        $searchCondition = SearchModel::searchCondition($customCondition, $customOptions);
        // 组合搜索商品url
        $urlList['product'] = SearchData::getProductUrl($searchCondition['condition']);
        // 组合搜索分类url
        $urlList['sort'] = SearchData::getClassesUrl($searchCondition['sortCondition']);
        // 组合搜索最新上架url
        $urlList['recent'] = SearchData::getRecentShelveUrl($searchCondition['condition']);

        $result = Yohobuy::getMulti($urlList, array(), true);
        // 组织模板数据
        $data = HelperSearch::getList($result, $searchCondition['options']);
        
        //new页面模拟数据
//            $data['newMain'] = array(
//                'banner' => 'http://img11.static.yhbimg.com/yhb-img01/2015/11/23/07/010a459d41b99a839cba9377532f1c19b2.jpg?imageView/3/w/970/h/200',
//                    'date' => '12月16日',
//                    'title' => '新品到着',
//                    'brands' => array(
//                        array(
//                            'href' => '',
//                            'logo' => 'http://img13.static.yhbimg.com/brandLogo/2012/02/28/15/02b2b5ded161ab31e2e097a327ed475052.jpg?imageView/2/w/170/h/120'
//                        ),
//                        array(
//                            'href' => '',
//                            'logo' => 'http://img13.static.yhbimg.com/brandLogo/2012/11/09/09/023721f44182f775d79904010af421331e.jpg?imageView/2/w/170/h/120'
//                        ),
//                        array(
//                            'href' => '',
//                            'logo' => 'http://img11.static.yhbimg.com/brandLogo/2012/12/13/17/01408fb72646c8f3fa59d870514f08a356.jpg?imageView/2/w/170/h/120'
//                        ),
//                        array(
//                            'href' => '',
//                            'logo' => 'http://img13.static.yhbimg.com/brandLogo/2012/12/24/13/0265b45e37af697c5ba12d5415fb341f27.jpg?imageView/2/w/170/h/120'
//                        ),
//                        array(
//                            'href' => '',
//                            'logo' => 'http://img11.static.yhbimg.com/brandLogo/2015/08/11/15/012d09a5cae187af1f6f3ed246b9b5a4fc.jpg?imageView/2/w/170/h/120'
//                        ),
//                        array(
//                            'href' => '',
//                            'logo' => 'http://img11.static.yhbimg.com/brandLogo/2015/08/20/16/01047ffb3ca182871821d551af31ac2378.jpg?imageView/2/w/170/h/120'
//                        )
//                    )
//            );
            
        return $data;
    }
    
}