diff --git a/library/WebPlugin/HelperSearch.php b/library/WebPlugin/HelperSearch.php index 6ef058a..e051e79 100644 --- a/library/WebPlugin/HelperSearch.php +++ b/library/WebPlugin/HelperSearch.php @@ -4,9 +4,6 @@ namespace WebPlugin; use WebPlugin\Paging; use LibModels\Web\Product\BrandData; -use LibModels\Web\Product\SearchData; -use Api\Yohobuy; -use Api\Sign; use Configs\ChannelConfig; use Index\HomeModel; /** @@ -317,7 +314,7 @@ class HelperSearch foreach ($sort as $key => $val) { //是否有品牌 - if ($options['action'] != 'brand' && $options['controller'] != 'index') { + if ($options['action'] != 'brand' && $options['controller'] != 'Index') { //若url参数有分类,设置msort导航 if (isset(self::$params['msort']) && self::$params['msort'] == $val['sort_id']) { self::$listNav[1] = array( @@ -1299,7 +1296,7 @@ class HelperSearch $type = isset(self::$params['msort']) && self::$params['msort'] ? self::$params['msort'] : ''; } //新品到着 - elseif ($controller == 'list' && $action == 'new') { + elseif ($controller == 'List' && $action == 'new') { if (isset(self::$params['shelve_time'])) { $date = explode(',', self::$params['shelve_time']); $date = date('Y-m-d', $date[0]); diff --git a/yohobuy/www.yohobuy.com/application/models/Product/New.php b/yohobuy/www.yohobuy.com/application/models/Product/New.php index 83f3c76..080ab1c 100644 --- a/yohobuy/www.yohobuy.com/application/models/Product/New.php +++ b/yohobuy/www.yohobuy.com/application/models/Product/New.php @@ -24,8 +24,6 @@ class NewModel $urlList['sort'] = SearchData::getClassesUrl($searchCondition['sortCondition']); // 组合搜索最新上架url $urlList['recent'] = SearchData::getRecentShelveUrl($searchCondition['condition']); - //用户浏览记录 - //$urlList['reviewUrl'] = HelperSearch::getReviewUrl($searchCondition['condition']); $result = Yohobuy::getMulti($urlList, array(), true); // 组织模板数据 diff --git a/yohobuy/www.yohobuy.com/application/models/Product/Search.php b/yohobuy/www.yohobuy.com/application/models/Product/Search.php index f5b6727..bc44275 100644 --- a/yohobuy/www.yohobuy.com/application/models/Product/Search.php +++ b/yohobuy/www.yohobuy.com/application/models/Product/Search.php @@ -102,7 +102,12 @@ class SearchModel $condition['attribute_not'] = 2; //默认排序 if (!isset($condition['order']) || empty($condition['order'])) { - $condition['order'] = 's_n_desc'; + //如果新品到着没传排序方式,默认按s_t_desc(新品)顺序排序 + if ($option['controller'] == 'List' && $option['action'] == 'new') { + $condition['order'] = 's_t_desc'; + }else{ + $condition['order'] = 's_n_desc'; + } } $options = array( 'imgSize' => $imgSize, diff --git a/yohobuy/www.yohobuy.com/application/modules/Product/controllers/Index.php b/yohobuy/www.yohobuy.com/application/modules/Product/controllers/Index.php index 6ed9780..3a6d5be 100644 --- a/yohobuy/www.yohobuy.com/application/modules/Product/controllers/Index.php +++ b/yohobuy/www.yohobuy.com/application/modules/Product/controllers/Index.php @@ -44,7 +44,7 @@ class IndexController extends WebAction $options['brandNameEn'] = isset($result['brandNameEn']) ? $result['brandNameEn'] : ''; $options['brandNameCn'] = isset($result['brandNameCn']) ? $result['brandNameCn'] : ''; $options['reviewNum'] = 6; - $options['controller'] = 'index'; + $options['controller'] = 'Index'; $options['action'] = 'brand'; //调用模型获得数据 @@ -90,10 +90,10 @@ class IndexController extends WebAction $options['brandId'] = isset($result['brandId']) ? $result['brandId'] : ''; $options['brandBanner'] = isset($result['brandBanner']) ? $result['brandBanner'] : ''; $options['brandAbout'] = isset($result['brandAbout']) ? $result['brandAbout'] : ''; - $options['controller'] = $this->_request->controller; - $options['action'] = $this->_request->action; + $options['controller'] = 'Index'; + $options['action'] = 'brand'; //调用模型获得数据 - $data = Product\BrandsModel::getBrandIntro($condition, $options); + $data = BrandsModel::getBrandIntro($condition, $options); $data = array( //初始化js diff --git a/yohobuy/www.yohobuy.com/application/modules/Product/controllers/List.php b/yohobuy/www.yohobuy.com/application/modules/Product/controllers/List.php index 2a6f6c1..0785833 100644 --- a/yohobuy/www.yohobuy.com/application/modules/Product/controllers/List.php +++ b/yohobuy/www.yohobuy.com/application/modules/Product/controllers/List.php @@ -15,8 +15,8 @@ class ListController extends WebAction $options = array( 'positionId' => $positionId, 'reviewNum' => 6, - 'controller' => $this->_request->controller,//TODO - 'action' => $this->_request->action + 'controller' => 'List', + 'action' => 'index' ); $indexData = IndexModel::getIndexData($condition, $options); @@ -35,12 +35,10 @@ class ListController extends WebAction */ public function newAction() { - $condition = array( - 'order' => 's_t_desc' - ); + $condition = array(); $options = array( 'reviewNum' => 6, - 'controller' => 'list', + 'controller' => 'List', 'action' => 'new' ); @@ -64,7 +62,7 @@ class ListController extends WebAction $options['reviewNum'] = 6; $condition = array(); $option = array( - 'controller' => 'list', + 'controller' => 'List', 'action' => 'sale', 'reviewNum'=>6 ); diff --git a/yohobuy/www.yohobuy.com/application/modules/Product/controllers/Sale.php b/yohobuy/www.yohobuy.com/application/modules/Product/controllers/Sale.php index a569b01..5ad1fb5 100644 --- a/yohobuy/www.yohobuy.com/application/modules/Product/controllers/Sale.php +++ b/yohobuy/www.yohobuy.com/application/modules/Product/controllers/Sale.php @@ -2,6 +2,7 @@ use Action\WebAction; use LibModels\Web\Product\SaleData; +use Product\SaleModel; /** * sale页 @@ -43,12 +44,12 @@ class SaleController extends WebAction } $options = array( - 'controller' => 'sale', + 'controller' => 'Sale', 'action' => 'index', 'reviewNum' => 6 ); - $saleData = Product\SaleModel::getSaleSearchData($condition, $options, $specialInfo); + $saleData = SaleModel::getSaleSearchData($condition, $options, $specialInfo); $data = array( //初始化js