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
yangyang
9 years ago
Commit
4656f74b6922c49b327aa80c94e5eb4f2783b751
1 parent
87126dca
统计前三个商品skn
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
62 additions
and
6 deletions
library/LibModels/Web/Product/SearchData.php
yohobuy/www.yohobuy.com/application/modules/Product/controllers/Index.php
yohobuy/www.yohobuy.com/application/modules/Product/controllers/List.php
yohobuy/www.yohobuy.com/application/modules/Product/controllers/Sale.php
library/LibModels/Web/Product/SearchData.php
View file @
4656f74
...
...
@@ -118,7 +118,8 @@ class SearchData
// return 'http://101.200.31.165/yohosearch/brand/list.json';
// return 'http://182.92.99.119:8080/yohosearch/brand/list.json';
}
return
'http://101.200.31.165/yohosearch/search.json'
;
return
'http://192.168.10.64:8080/yohosearch/search.json'
;
// return 'http://101.200.31.165/yohosearch/search.json';
//return 'http://101.200.31.165/yohosearch/search.json';
// return 'http://182.92.99.119:8080/yohosearch/search.json';
}
...
...
yohobuy/www.yohobuy.com/application/modules/Product/controllers/Index.php
View file @
4656f74
...
...
@@ -58,12 +58,23 @@ class IndexController extends WebAction
$options
[
'action'
]
=
'brand'
;
//说明当前方法名
//调用模型获得品牌页数据
$data
=
BrandsModel
::
getBrandSearchData
(
$condition
,
$options
);
$data
=
BrandsModel
::
getBrandSearchData
(
$condition
,
$options
);
//统计前三个商品
$skn
=
array
();
if
(
isset
(
$data
[
'goods'
])
&&
!
empty
(
$data
[
'goods'
]))
{
$arr
=
array_slice
(
$data
[
'goods'
],
0
,
3
);
foreach
(
$arr
as
$key
=>
$value
)
{
$skn
[]
=
$value
[
'skn'
];
}
}
$seo
=
$data
[
'seo'
];
$data
=
array
(
//初始化js
'brandPage'
=>
true
,
'list'
=>
$data
'list'
=>
$data
,
'skn'
=>
$skn
);
$this
->
setBrandSeo
(
$seo
);
$this
->
setWebNavHeader
();
...
...
yohobuy/www.yohobuy.com/application/modules/Product/controllers/List.php
View file @
4656f74
...
...
@@ -28,10 +28,21 @@ class ListController extends WebAction
$this
->
setListSeo
(
$list
[
'seo'
]);
/// 设置头部数据
$this
->
setWebNavHeader
();
//统计前三个商品
$skn
=
array
();
if
(
isset
(
$list
[
'goods'
])
&&
!
empty
(
$list
[
'goods'
]))
{
$arr
=
array_slice
(
$list
[
'goods'
],
0
,
3
);
foreach
(
$arr
as
$key
=>
$value
)
{
$skn
[]
=
$value
[
'skn'
];
}
}
// 渲染模板
$this
->
_view
->
display
(
'list'
,
array
(
'productListPage'
=>
true
,
// JS控制初始化
'list'
=>
$list
,
'skn'
=>
$skn
));
}
...
...
@@ -50,9 +61,20 @@ class ListController extends WebAction
);
$newData
=
NewModel
::
getNewSearchData
(
$condition
,
$options
);
//统计前三个商品
$skn
=
array
();
if
(
isset
(
$newData
[
'goods'
])
&&
!
empty
(
$newData
[
'goods'
]))
{
$arr
=
array_slice
(
$newData
[
'goods'
],
0
,
3
);
foreach
(
$arr
as
$key
=>
$value
)
{
$skn
[]
=
$value
[
'skn'
];
}
}
$data
=
array
(
'productListPage'
=>
true
,
'newSale'
=>
$newData
'newSale'
=>
$newData
,
'skn'
=>
$skn
);
// 设置SEO信息
$this
->
setNewSeo
(
$newData
[
'seo'
]);
...
...
@@ -77,10 +99,21 @@ class ListController extends WebAction
$condition
[
'p_d'
]
=
'0.01,0.99'
;
}
$list
=
SearchModel
::
getListData
(
$condition
,
$option
);
//统计前三个商品
$skn
=
array
();
if
(
isset
(
$list
[
'goods'
])
&&
!
empty
(
$list
[
'goods'
]))
{
$arr
=
array_slice
(
$list
[
'goods'
],
0
,
3
);
foreach
(
$arr
as
$key
=>
$value
)
{
$skn
[]
=
$value
[
'skn'
];
}
}
$data
=
array
(
//初始化js
'brandPage'
=>
true
,
'list'
=>
$list
'list'
=>
$list
,
'skn'
=>
$skn
);
// 设置SEO信息
$this
->
setSaleSeo
(
$list
[
'seo'
]);
...
...
yohobuy/www.yohobuy.com/application/modules/Product/controllers/Sale.php
View file @
4656f74
...
...
@@ -52,10 +52,21 @@ class SaleController extends WebAction
);
$saleData
=
SaleModel
::
getSaleSearchData
(
$condition
,
$options
,
$specialInfo
);
//统计前三个商品
$skn
=
array
();
if
(
isset
(
$saleData
[
'goods'
])
&&
!
empty
(
$saleData
[
'goods'
]))
{
$arr
=
array_slice
(
$saleData
[
'goods'
],
0
,
3
);
foreach
(
$arr
as
$key
=>
$value
)
{
$skn
[]
=
$value
[
'skn'
];
}
}
$data
=
array
(
//初始化js
'productListPage'
=>
true
,
'newSale'
=>
$saleData
'newSale'
=>
$saleData
,
'skn'
=>
$skn
);
$this
->
setTitle
(
'潮流商品搜索 | YOHO!有货'
);
$this
->
setKeywords
(
'Yoho! 有货,潮流,时尚,流行,购物,B2C,正品,购物网站,网上购物,货到付款,品牌服饰,男士护肤,黑框眼镜,匡威,板鞋,i.t,izzue,5cm,eastpak,vans,lylescott,g-shock,new balance,lacoste,melissa,casio,卡西欧手表,舒雅,jasonwood,odm,AAAA,香港购物,日本潮流'
);
...
...
Please
register
or
login
to post a comment