Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
YOHOBUYWAP
·
Commits
Go to a project
GitLab
Go to group
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
Rock Zhang
9 years ago
Commit
8bbd58a19b21114d1f4f69e0b0dd6118df049beb
1 parent
542e7537
购物车页面支持cartType参数来确定tab高亮
Code Review By Rock Zhang
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
4 deletions
yohobuy/m.yohobuy.com/application/models/Index/Cart.php
yohobuy/m.yohobuy.com/application/modules/Cart/controllers/Index.php
yohobuy/m.yohobuy.com/application/models/Index/Cart.php
View file @
8bbd58a
...
...
@@ -46,7 +46,7 @@ class CartModel
*
* @param integer $uid 用户ID
* @param string $shoppingKey 未登录用户唯一识别码
* @param string $cartType 购物车类型
* @param string $cartType 购物车类型
,默认是是所有购物车,ordinary为普通购物车,advance为预售购物车
* @param bool $onlyGift 只获取赠品的商品数据
* @param bool $onlyAdvanceBuy 只获取加价购的商品数据
* @return array|mixed 处理之后的购物车数据
...
...
@@ -73,7 +73,8 @@ class CartModel
$cart
=
$cartData
[
'data'
];
if
(
$cartType
!==
'all'
)
{
// 加价购或者赠品数据
$cartTypes
=
array
(
'ordinary'
,
'advance'
,
'all'
);
if
(
!
in_array
(
$cartType
,
$cartTypes
))
{
// 加价购或者赠品数据
$result
=
self
::
procCartData
(
$cart
[
'ordinary_cart_data'
],
$onlyGift
,
$onlyAdvanceBuy
);
break
;
}
...
...
@@ -99,7 +100,7 @@ class CartModel
// 以上两个购物车中都有数据, 默认显示普通购物车
else
{
$result
[
'cartNav'
]
=
true
;
$result
[
'cartType'
]
=
'ordinary'
;
$result
[
'cartType'
]
=
$cartType
!==
'all'
?
$cartType
:
'ordinary'
;
}
/* 普通购物车 */
...
...
yohobuy/m.yohobuy.com/application/modules/Cart/controllers/Index.php
View file @
8bbd58a
...
...
@@ -40,10 +40,11 @@ class IndexController extends AbstractAction
$shoppingKey
=
Helpers
::
getShoppingKeyByCookie
();
$uid
=
$this
->
getUid
(
true
);
$cartType
=
$this
->
get
(
'cartType'
,
'all'
);
$data
=
array
(
'shoppingCartPage'
=>
true
,
'shoppingCart'
=>
CartModel
::
getCartData
(
$uid
,
$shoppingKey
)
'shoppingCart'
=>
CartModel
::
getCartData
(
$uid
,
$shoppingKey
,
$cartType
)
);
// 渲染模板
...
...
Please
register
or
login
to post a comment