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
whb
9 years ago
Commit
91b06bd8e4459fcb0ef975fd895fdaa258323a49
1 parent
2e1d71c8
PC购物车修改
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
14 deletions
yohobuy/www.yohobuy.com/application/modules/Cart/controllers/Index.php
yohobuy/www.yohobuy.com/application/modules/Cart/controllers/Index.php
View file @
91b06bd
...
...
@@ -21,7 +21,7 @@ class IndexController extends WebAction
*/
public
function
indexAction
()
{
$uid
=
$this
->
getUid
(
tru
e
);
$uid
=
$this
->
getUid
(
fals
e
);
$shoppingKey
=
Helpers
::
getShoppingKeyByCookie
();
// 显示一次并清除已删除的COOKIE记录
...
...
@@ -52,7 +52,7 @@ class IndexController extends WebAction
if
(
$this
->
isAjax
())
{
$productId
=
$this
->
post
(
'skuList'
,
0
);
$hasPromotion
=
$this
->
post
(
'hasPromotion'
,
false
);
$uid
=
$this
->
getUid
(
tru
e
);
$uid
=
$this
->
getUid
(
fals
e
);
$shoppingKey
=
Helpers
::
getShoppingKeyByCookie
();
$result
=
CartModel
::
selectGoods
(
$uid
,
$productId
,
$shoppingKey
,
$hasPromotion
);
}
...
...
@@ -75,7 +75,7 @@ class IndexController extends WebAction
if
(
$this
->
isAjax
())
{
$shoppingKey
=
Helpers
::
getShoppingKeyByCookie
();
$uid
=
$this
->
getUid
(
tru
e
);
$uid
=
$this
->
getUid
(
fals
e
);
$sku
=
$this
->
post
(
'sku'
,
0
);
$increaseNum
=
$this
->
post
(
'increaseNum'
,
null
);
$decreaseNum
=
$this
->
post
(
'decreaseNum'
,
null
);
...
...
@@ -103,7 +103,7 @@ class IndexController extends WebAction
if
(
$this
->
isAjax
())
{
$skuList
=
$this
->
post
(
'skuList'
,
0
);
$hasPromotion
=
true
;
//$this->post('hasPromotion', false);
$uid
=
$this
->
getUid
(
tru
e
);
$uid
=
$this
->
getUid
(
fals
e
);
$shoppingKey
=
Helpers
::
getShoppingKeyByCookie
();
$result
=
CartModel
::
removeFromCart
(
$uid
,
$skuList
,
$shoppingKey
,
$hasPromotion
);
if
(
!
empty
(
$result
[
'code'
])
&&
$result
[
'code'
]
==
200
)
{
...
...
@@ -130,7 +130,7 @@ class IndexController extends WebAction
if
(
$this
->
isAjax
())
{
$skuList
=
$this
->
post
(
'skuList'
);
$hasPromotion
=
$this
->
post
(
'hasPromotion'
,
false
);
$uid
=
$this
->
getUid
(
tru
e
);
$uid
=
$this
->
getUid
(
fals
e
);
$result
=
CartModel
::
addToFav
(
$uid
,
$skuList
,
$hasPromotion
);
if
(
!
empty
(
$result
[
'code'
])
&&
$result
[
'code'
]
==
200
)
{
$this
->
setShoppingCookie
(
$uid
);
...
...
@@ -217,14 +217,14 @@ class IndexController extends WebAction
$refer
=
Helpers
::
url
(
'/cart/index/orderEnsure'
,
array
(
'type'
=>
$type
));
// 审判用户是否已登录
$this
->
auditJumpLogin
(
tru
e
,
$refer
);
$this
->
auditJumpLogin
(
fals
e
,
$refer
);
$this
->
setTitle
(
'填写订单'
,
true
,
' | '
);
$this
->
setSimpleHeader
();
$cartType
=
(
$type
==
2
)
?
'advance'
:
'ordinary'
;
$isAdvanceCart
=
(
$type
==
2
)
?
true
:
false
;
$uid
=
$this
->
getUid
(
tru
e
);
$uid
=
$this
->
getUid
(
fals
e
);
$orderEnsure
=
CartModel
::
cartPay
(
$uid
,
$cartType
,
$isAdvanceCart
);
if
(
empty
(
$orderEnsure
))
{
...
...
@@ -247,7 +247,7 @@ class IndexController extends WebAction
$result
=
array
(
'code'
=>
200
,
'data'
=>
array
(),
'message'
=>
'地址信息'
);
if
(
$this
->
isAjax
())
{
$uid
=
$this
->
getUid
(
tru
e
);
$uid
=
$this
->
getUid
(
fals
e
);
$result
[
'data'
]
=
CartModel
::
userAddressList
(
$uid
);
}
...
...
@@ -265,7 +265,7 @@ class IndexController extends WebAction
$result
=
array
();
if
(
$this
->
isAjax
())
{
$uid
=
$this
->
getUid
(
tru
e
);
$uid
=
$this
->
getUid
(
fals
e
);
$addressId
=
$this
->
post
(
'id'
);
$result
=
CartModel
::
setDefaultAddress
(
$uid
,
$addressId
);
}
...
...
@@ -292,7 +292,7 @@ class IndexController extends WebAction
$result
=
array
();
if
(
$this
->
isAjax
())
{
$uid
=
$this
->
getUid
(
tru
e
);
$uid
=
$this
->
getUid
(
fals
e
);
$id
=
$this
->
post
(
'id'
,
null
);
$address
=
$this
->
post
(
'address'
,
''
);
$areaCode
=
$this
->
post
(
'areaCode'
,
''
);
...
...
@@ -324,7 +324,7 @@ class IndexController extends WebAction
$result
=
array
();
if
(
$this
->
isAjax
())
{
$uid
=
$this
->
getUid
(
tru
e
);
$uid
=
$this
->
getUid
(
fals
e
);
$addressId
=
$this
->
post
(
'id'
);
$result
=
CartModel
::
delAddress
(
$uid
,
$addressId
);
}
...
...
@@ -360,7 +360,7 @@ class IndexController extends WebAction
$result
=
array
(
'code'
=>
200
,
'message'
=>
'优惠券信息'
,
'data'
=>
array
());
if
(
$this
->
isAjax
())
{
$uid
=
$this
->
getUid
(
tru
e
);
$uid
=
$this
->
getUid
(
fals
e
);
$result
[
'data'
]
=
CartModel
::
getCouponList
(
$uid
);
}
...
...
@@ -389,7 +389,7 @@ class IndexController extends WebAction
$couponCode
=
$this
->
post
(
'couponCode'
,
null
);
$yohoCoin
=
$this
->
post
(
'yohoCoin'
,
null
);
$redEnvelopes
=
$this
->
post
(
'redEnvelopes'
,
null
);
$uid
=
$this
->
getUid
(
tru
e
);
$uid
=
$this
->
getUid
(
fals
e
);
$result
=
CartModel
::
orderCompute
(
$uid
,
$cartType
,
$deliveryWay
,
$paymentType
,
$couponCode
,
$yohoCoin
,
$redEnvelopes
);
}
...
...
@@ -426,7 +426,7 @@ class IndexController extends WebAction
}
// 判断用户是否登录
$uid
=
$this
->
getUid
(
tru
e
);
$uid
=
$this
->
getUid
(
fals
e
);
if
(
!
$uid
)
{
$result
[
'message'
]
=
'请先登录'
;
break
;
...
...
Please
register
or
login
to post a comment