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
Plain Diff
Browse Files
Authored by
毕凯
9 years ago
Commit
ea93c8c29fd6858e6de8bb33962fd1a1dc7b7971
2 parents
2c79a11d
ade11f0f
Merge branch 'develop' of
http://git.dev.yoho.cn/web/yohobuy
into develop
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
yohobuy/m.yohobuy.com/application/models/Index/Cart.php
yohobuy/m.yohobuy.com/application/models/Index/Cart.php
View file @
ea93c8c
...
...
@@ -50,7 +50,7 @@ class CartModel
*/
public
static
function
getCartData
(
$uid
,
$shoppingKey
,
$cartType
=
'all'
,
$onlyGift
=
false
,
$onlyAdvanceBuy
=
false
)
{
$result
=
array
(
'cartNav'
=>
true
);
$result
=
array
(
'cartNav'
=>
true
,
'commonGoodsCount'
=>
'0'
,
'presellGoodsCount'
=>
'0'
);
// 用户是否登录
if
(
empty
(
$uid
))
{
...
...
@@ -73,21 +73,21 @@ class CartModel
break
;
}
$ordinaryCount
=
intval
(
$cart
[
'ordinary_cart_data'
][
'shopping_cart_data'
][
'goods_count'
]);
$advanceCount
=
intval
(
$cart
[
'advance_cart_data'
][
'shopping_cart_data'
][
'goods_count'
]);
$ordinaryCount
=
strval
(
$cart
[
'ordinary_cart_data'
][
'shopping_cart_data'
][
'goods_count'
]);
$advanceCount
=
strval
(
$cart
[
'advance_cart_data'
][
'shopping_cart_data'
][
'goods_count'
]);
// 普通购物车和预售购物车都为空
if
(
$ordinaryCount
===
0
&&
$advanceCount
===
0
)
{
if
(
$ordinaryCount
===
'0'
&&
$advanceCount
===
'0'
)
{
$result
[
'isEmptyCart'
]
=
true
;
break
;
}
/* 普通购物车 */
$result
[
'commonGoodsCount'
]
=
$ordinaryCount
;
$result
[
'commonCart'
]
=
self
::
procCartData
(
$cart
[
'ordinary_cart_data'
],
$onlyGift
,
$onlyAdvanceBuy
);
/* 预售购物车 */
$result
[
'presellGoodsCount'
]
=
$advanceCount
;
$result
[
'preSellCart'
]
=
self
::
procCartData
(
$cart
[
'advance_cart_data'
],
$onlyGift
,
$onlyAdvanceBuy
);
}
while
(
0
);
}
while
(
false
);
return
$result
;
}
...
...
@@ -156,8 +156,8 @@ class CartModel
if
(
empty
(
$uid
))
{
$result
[
'code'
]
=
300
;
$reult
[
'message'
]
=
'请先登录'
;
$result
[
'data'
]
=
'/signin.html'
;
$result
[
'message'
]
=
'请先登录'
;
$result
[
'data'
]
=
Helpers
::
url
(
'/signin.html'
);
return
$result
;
}
...
...
Please
register
or
login
to post a comment