Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
YOHOBUYPC
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
2
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
hf
9 years ago
Commit
1353d8b2307a3deeaa7abae8baccb25f0358d9bf
1 parent
60cb17c3
fixes bug refs YW-1021
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
51 deletions
yohobuy/m.yohobuy.com/application/models/Category/Brand.php
yohobuy/m.yohobuy.com/application/models/Product/Filter.php
yohobuy/m.yohobuy.com/application/models/Category/Brand.php
View file @
1353d8b
...
...
@@ -60,8 +60,18 @@ class BrandModel
// 搜索链接地址
$result
[
'searchUrl'
]
=
Helpers
::
url
(
'/brands/search'
,
null
);
/* 顶部的轮翻广告列表 */
if
(
!
empty
(
$brand
[
'brandTop'
][
0
][
'data'
]))
{
/* 顶部的轮翻广告或热门品牌列表(当没有轮翻广告的情况下会是这个样子的! 此处是根据接口改造成的逻辑) */
if
(
!
empty
(
$brand
[
'brandTop'
][
0
][
'data'
][
'list'
]))
{
$build
=
array
();
foreach
(
$brand
[
'brandTop'
][
0
][
'data'
][
'list'
]
as
$value
)
{
$build
[
'url'
]
=
Helpers
::
getFilterUrl
(
$value
[
'url'
]);
$build
[
'img'
]
=
Helpers
::
getImageUrl
(
$value
[
'src'
],
144
,
144
);
$build
[
'name'
]
=
$value
[
'name'
];
$result
[
'hotBrand'
][
'list'
][]
=
$build
;
}
}
// 顶部的轮翻广告列表
elseif
(
!
empty
(
$brand
[
'brandTop'
][
0
][
'data'
]))
{
$build
=
array
();
foreach
(
$brand
[
'brandTop'
][
0
][
'data'
]
as
$value
)
{
$build
[
'url'
]
=
Helpers
::
getFilterUrl
(
$value
[
'url'
]);
...
...
@@ -71,7 +81,7 @@ class BrandModel
}
}
/* 顶部的热门品牌列表 */
/* 顶部的热门品牌列表
(备注: 当没有轮翻广告的时候,此处内部的foreach不会被执行)
*/
if
(
!
empty
(
$brand
[
'brandTop'
][
1
][
'data'
][
'list'
]))
{
$build
=
array
();
foreach
(
$brand
[
'brandTop'
][
1
][
'data'
][
'list'
]
as
$value
)
{
...
...
yohobuy/m.yohobuy.com/application/models/Product/Filter.php
deleted
100644 → 0
View file @
60cb17c
<?php
namespace
Product
;
use
Configs\CacheConfig
;
use
LibModels\Wap\Product\SearchData
;
use
LibModels\Wap\Category\BrandData
;
use
LibModels\Wap\Category\ClassData
;
use
Plugin\DataProcess\ListProcess
;
/**
* 搜索相关的模板数据模型
*
* @name Filter
* @package Product
* @copyright yoho.inc
* @version 1.0 (2015-11-1 17:35:52)
*/
class
FilterModel
{
/**
* 获取筛选的数据
*
* @param array $condition 查询条件
* @return array
*/
public
static
function
getFilterData
(
$condition
)
{
$result
=
array
();
// 区别各种列表页面的筛选数据
if
(
isset
(
$condition
[
'brand'
]))
{
$listData
=
BrandData
::
filterBrandData
(
$condition
);
}
else
if
(
isset
(
$condition
[
'sort'
]))
{
$listData
=
ClassData
::
filterClassData
(
$condition
);
}
else
{
$listData
=
SearchData
::
searchByCondition
(
$condition
);
}
if
(
isset
(
$listData
[
'data'
])
&&
isset
(
$listData
[
'data'
][
'filter'
]))
{
$result
[
'filter'
]
=
ListProcess
::
getFilterData
(
$listData
[
'data'
][
'filter'
]);
}
return
$result
;
}
}
Please
register
or
login
to post a comment