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
周少峰
9 years ago
Commit
025307628b58c80a182880ee9024a46d6f5ebae1
1 parent
6abcfb46
调整返回前台的数据结构
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
15 deletions
library/Plugin/HelperSearch.php
yohobuy/www.yohobuy.com/application/modules/Product/controllers/List.php
library/Plugin/HelperSearch.php
View file @
0253076
...
...
@@ -123,15 +123,31 @@ class HelperSearch
'pageCount'
=>
$result
[
'page_total'
],
'nextHref'
=>
$result
[
'filter'
][
'next'
]
),
'hasNextPage'
=>
array
(
'href'
=>
$result
[
'filter'
][
'next'
],
'src'
=>
'http://img10.static.yhbimg.com/product/2014/01/15/11/01fa01614784f6239760f1b749663016f1.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90'
),
'goods'
=>
$result
[
'product_list'
],
'allSort'
=>
array
(
//'updateNum' => $result['filter']['group_sort']['all']['num'],
'list'
=>
$result
[
'filter'
][
'group_sort'
][
'list'
]
'leftContent'
=>
array
(
array
(
'allSort'
=>
array
(
//'updateNum' => $result['filter']['group_sort']['all']['num'],
'list'
=>
$result
[
'filter'
][
'group_sort'
][
'list'
]
)
),
array
(
'advNav'
=>
array
()
),
array
(
'advPic'
=>
array
()
),
array
(
'newSales'
=>
$result
[
'filter'
][
'recent'
]
),
array
(
'allDiscount'
=>
$result
[
'filter'
][
'discount'
])
),
'advNav'
=>
array
(),
'advPic'
=>
array
(),
'newSales'
=>
$result
[
'filter'
][
'recent'
],
'allDiscount'
=>
$result
[
'filter'
][
'discount'
]
'totalCount'
=>
$result
[
'total'
],
);
return
$data
;
}
...
...
@@ -150,8 +166,6 @@ class HelperSearch
$isLimit
=
isset
(
$val
[
'is_limited'
])
&&
$val
[
'is_limited'
]
===
'Y'
;
//即将售罄
$isFew
=
$val
[
'is_soon_sold_out'
]
===
'Y'
?
true
:
false
;
$is_promotion
=
$val
[
'is_promotion'
];
//SALE
//新品节
//再到着
...
...
@@ -167,8 +181,7 @@ class HelperSearch
$result
[]
=
array
(
'tags'
=>
array
(
'isNew'
=>
$isNew
,
'isLimit'
=>
$isLimit
,
'isYearEndPromotion'
=>
$is_promotion
'isLimit'
=>
$isLimit
),
'url'
=>
$goods_list
[
0
][
'url'
],
'thumb'
=>
$val
[
'default_images'
],
...
...
@@ -1104,7 +1117,7 @@ class HelperSearch
if (empty(
$list
)) {
return array();
}
$params
=
$_GET
;
$params
=
self::
$params
;
$query
= array();
if (isset(
$params['gender']
)) {
$query['gender']
=
$params['gender']
;
...
...
@@ -1116,16 +1129,16 @@ class HelperSearch
$query['misort']
=
$params['misort']
;
}
$data
= array();
$total
= 0;
$i
= 0;
foreach (
$list
as
$k
=>
$v
) {
$total
+=
$v
;
$star_time
= strtotime(
$k
);
$end_time
=
$star_time
+60*60*24;
$query['shelve_time']
= '';
$query['shelve_time']
=
$star_time
.','.
$end_time
;
if (isset(
$params['shelve_time']
) &&
$query['shelve_time']
==
$params['shelve_time']
) {
$data[$i]['active']
= true;
}
@
$data[$i]['href']
= self::buildurl(
$query
);
//
$data[$i]['num']
=
$v
;
$data[$i]['name']
=
$k
;
$i
++;
}
...
...
yohobuy/www.yohobuy.com/application/modules/Product/controllers/List.php
View file @
0253076
...
...
@@ -81,6 +81,7 @@ class ListController extends WebAction
$params
=
$condition
+
$_GET
;
$params
=
array_filter
(
$params
);
$data
=
SearchModel
::
getSearchData
(
$params
,
$options
);
// print_r($data); exit;
$cate
=
array
(
'boys'
,
'girls'
,
'kids'
,
'lifestyle'
);
$this
->
setWebNavHeader
(
$cate
[
$gender
-
1
]);
$this
->
_view
->
display
(
'list'
,
$data
);
...
...
Please
register
or
login
to post a comment