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
Rock Zhang
9 years ago
Commit
82435a40bc8821742701aed1516d3d39ecdecd0e
1 parent
b86782b9
修复预售商品结算时,选择地址之后会变为普通购物车的bug
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
8 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 @
82435a4
...
...
@@ -313,10 +313,10 @@ class CartModel
*
* @param int $uid 用户ID
* @param string $cartType 购物车类型,ordinary表示普通购物车
* @param
null|string $cookieData
cookie中记录的一些订单有关数据
* @param
array $orderInfo
cookie中记录的一些订单有关数据
* @return array 接口返回的数据
*/
public
static
function
cartPay
(
$uid
,
$cartType
,
$
cookieData
)
public
static
function
cartPay
(
$uid
,
$cartType
,
$
orderInfo
)
{
$result
=
array
();
...
...
@@ -324,13 +324,11 @@ class CartModel
if
(
$pay
&&
isset
(
$pay
[
'code'
])
&&
$pay
[
'code'
]
===
200
)
{
$payReturn
=
$pay
[
'data'
];
$orderInfo
=
array
();
$address
=
array
();
$orderCompute
=
array
();
// cookie保存的数据
if
(
!
empty
(
$cookieData
))
{
$orderInfo
=
json_decode
(
$cookieData
,
true
);
if
(
!
empty
(
$orderInfo
))
{
$orderCompute
=
self
::
orderCompute
(
$uid
,
$cartType
,
$orderInfo
[
'deliveryId'
],
$orderInfo
[
'paymentTypeId'
],
$orderInfo
[
'couponCode'
],
$orderInfo
[
'yohoCoin'
]);
}
...
...
yohobuy/m.yohobuy.com/application/modules/Cart/controllers/Index.php
View file @
82435a4
...
...
@@ -277,6 +277,12 @@ class IndexController extends AbstractAction
// 购物车商品为空跳转到购物车页面
$cartType
=
$this
->
get
(
'cartType'
,
'ordinary'
);
$cookieData
=
$this
->
getCookie
(
'order-info'
,
null
);
$orderInfo
=
array
();
if
(
!
empty
(
$cookieData
))
{
$orderInfo
=
json_decode
(
$cookieData
,
true
);
$cartType
=
$orderInfo
[
'cartType'
];
}
$cartKey
=
'commonCart'
;
if
(
$cartType
===
'advance'
)
{
$cartKey
=
'preSellCart'
;
...
...
@@ -289,12 +295,10 @@ class IndexController extends AbstractAction
$this
->
go
(
Helpers
::
url
(
'/cart/index/index'
));
}
$cookieData
=
$this
->
getCookie
(
'order-info'
,
null
);
$uid
=
$this
->
getUid
(
true
);
$data
=
array
(
'orderEnsurePage'
=>
true
,
'isOrdinaryCart'
=>
(
$cartType
!==
'advance'
),
'orderEnsure'
=>
CartModel
::
cartPay
(
$uid
,
$cartType
,
$
cookieData
)
'orderEnsure'
=>
CartModel
::
cartPay
(
$uid
,
$cartType
,
$
orderInfo
)
);
$this
->
_view
->
display
(
'order-ensure'
,
$data
);
...
...
Please
register
or
login
to post a comment