Toggle navigation
Toggle navigation
This project
Loading...
Sign in
wangshusheng
/
YOHOBUYPC
·
Commits
Go to a project
GitLab
Go to dashboard
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
yangyang
9 years ago
Commit
012e58aef54cfde9b4389ca9c2b23ed22ec327f1
1 parent
469f49df
品牌首页收藏品牌修改
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
1 deletions
library/LibModels/Web/Product/FavoriteData.php
library/WebPlugin/HelperSearch.php
yohobuy/www.yohobuy.com/application/modules/Product/controllers/Index.php
library/LibModels/Web/Product/FavoriteData.php
View file @
012e58a
...
...
@@ -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/WebPlugin/HelperSearch.php
View file @
012e58a
...
...
@@ -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 @
012e58a
<?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