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
Plain Diff
Browse Files
Authored by
whb
9 years ago
Commit
2f2e00b51d0ca0e4e3562f29a5d9556eb932b58c
2 parents
0f35ad6a
012e58ae
Merge branch 'develop' of
http://git.dev.yoho.cn/web/yohobuy
into develop
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
32 additions
and
4 deletions
library/LibModels/Web/Product/FavoriteData.php
library/Plugin/DataProcess/FloorProcess.php
library/WebPlugin/HelperSearch.php
yohobuy/www.yohobuy.com/application/modules/Product/controllers/Index.php
library/LibModels/Web/Product/FavoriteData.php
View file @
2f2e00b
...
...
@@ -44,4 +44,14 @@ class FavoriteData {
return
Yohobuy
::
yarClient
(
Yohobuy
::
SERVICE_URL
.
self
::
URL_PRODUCT_FAVORITE
,
'delUidProductFav'
,
array
(
$uid
,
$productSkn
));
}
/**
* 根据uid和商品的skn添加或取消收藏品牌
* @param $uid
* @param $productSkn
* @return bool
*/
public
static
function
changeFavoriteBrand
(
$uid
,
$productSkn
)
{
return
Yohobuy
::
yarClient
(
Yohobuy
::
SERVICE_URL
.
self
::
URL_PRODUCT_FAVORITE
,
'toggleBrandFav'
,
array
(
$uid
,
$productSkn
));
}
}
...
...
library/Plugin/DataProcess/FloorProcess.php
View file @
2f2e00b
...
...
@@ -208,7 +208,7 @@ class FloorProcess
foreach
(
$data
[
'list'
]
as
&
$one
)
{
if
(
isset
(
$one
[
'url'
]))
{
$one
[
'url'
]
=
Helpers
::
getFilterUrl
(
$one
[
'url'
]);
isset
(
self
::
$channel
[
$type
])
&&
$one
[
'url'
]
.=
'?gender='
.
self
::
$channel
[
$type
];
//
isset(self::$channel[$type]) && $one['url'] .= '?gender=' . self::$channel[$type];
}
$one
[
'img'
]
=
Helpers
::
getImageUrl
(
$one
[
'src'
],
158
,
174
);
unset
(
$one
[
'src'
]);
...
...
@@ -428,9 +428,9 @@ class FloorProcess
{
// URL附加参数
$param
=
''
;
if
(
isset
(
self
::
$channel
[
$type
]))
{
/*
if (isset(self::$channel[$type])) {
$param = '/?gender=' . self::$channel[$type];
}
}
*/
$result
=
array
();
$result
[
'hotBrandsScroll'
][
'name'
]
=
$data
[
'title'
][
'title'
];
...
...
library/WebPlugin/HelperSearch.php
View file @
2f2e00b
...
...
@@ -95,7 +95,7 @@ class HelperSearch
$result
[
'leftContent'
][][
'newSales'
]
=
self
::
recentShelve
(
$data
[
'recent'
][
'recent'
]);
}
//品牌banner
$result
[
'brandBanner'
]
=
isset
(
$data
[
'brand'
])
?
self
::
getBannerFormat
(
$data
[
'brand'
],
$options
[
'brandBanner'
])
:
array
();
$result
[
'brandBanner'
]
=
isset
(
$data
[
'brand'
])
&&
!
empty
(
$data
[
'brand'
])
?
self
::
getBannerFormat
(
$data
[
'brand'
],
$options
[
'brandBanner'
])
:
array
();
//总记录数
if
(
isset
(
$data
[
'product'
][
'total'
]))
{
$result
[
'totalCount'
]
=
$data
[
'product'
][
'total'
];
...
...
yohobuy/www.yohobuy.com/application/modules/Product/controllers/Index.php
View file @
2f2e00b
<?php
use
Action\WebAction
;
use
LibModels\Web\Product\BrandData
;
use
LibModels\Web\Product\FavoriteData
;
use
\LibModels\Web\Product\HotrankData
;
use
product\HotrankModel
;
...
...
@@ -50,6 +51,7 @@ class IndexController extends WebAction
//调用模型获得数据
$data
=
Product\BrandsModel
::
getBrandSearchData
(
$condition
,
$options
);
$data
=
array
(
//初始化js
'searchListPage'
=>
true
,
...
...
@@ -106,6 +108,22 @@ class IndexController extends WebAction
//渲染模板
$this
->
_view
->
display
(
'list'
,
$data
);
}
//收藏品牌
public
function
favoriteBrandAction
(
$uid
=
''
,
$brandId
=
''
)
{
if
(
!
$this
->
isAjax
())
{
return
;
}
if
(
$uid
&&
$brandId
)
{
//调用接口收藏或取消收藏
$result
=
FavoriteData
::
changeFavoriteBrand
(
$uid
,
$brandId
);
if
(
isset
(
$result
[
'code'
])
&&
$result
[
'code'
]
==
200
)
{
$this
->
echoJson
(
$result
[
'message'
]);
}
}
}
/**
* 热销排行
*/
...
...
Please
register
or
login
to post a comment