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
c6d89c6baf6f47c43495a32889aa8a596f4668a1
1 parent
2082a056
再次优化限购商品结算判定接口
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
3 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 @
c6d89c6
...
...
@@ -318,9 +318,10 @@ class CartModel
* @param string $sku 商品sku,用于限购商品购买
* @param stirng $skn 商品skn,用于限购商品购买
* @param int $buyNumber 购买商品数目,用户限购商品支付
* @param bool $isAjax 是否是异步请求
* @return array 接口返回的数据
*/
public
static
function
cartPay
(
$uid
,
$cartType
,
$orderInfo
,
$limitProductCode
,
$sku
,
$skn
,
$buyNumber
)
public
static
function
cartPay
(
$uid
,
$cartType
,
$orderInfo
,
$limitProductCode
,
$sku
,
$skn
,
$buyNumber
,
$isAjax
=
false
)
{
$result
=
array
();
...
...
@@ -353,6 +354,10 @@ class CartModel
break
;
}
if
(
$isAjax
)
{
// 如果是异步请求,求直接返回,不进行下面的处理,从而优化性能
break
;
}
$payReturn
=
$pay
[
'data'
];
$address
=
array
();
$orderCompute
=
array
();
...
...
yohobuy/m.yohobuy.com/application/modules/Cart/controllers/Index.php
View file @
c6d89c6
...
...
@@ -302,12 +302,14 @@ class IndexController extends AbstractAction
// 购物车商品为空跳转到购物车页面
$uid
=
$this
->
getUid
(
true
);
$order
=
CartModel
::
cartPay
(
$uid
,
$cartType
,
$orderInfo
,
$limitProductCode
,
$sku
,
$skn
,
$buyNumber
);
$isAjax
=
$this
->
isAjax
();
$order
=
CartModel
::
cartPay
(
$uid
,
$cartType
,
$orderInfo
,
$limitProductCode
,
$sku
,
$skn
,
$buyNumber
,
$isAjax
);
if
(
isset
(
$order
[
'cartUrl'
]))
{
// 普通或者预售商品为空时
$this
->
go
(
$order
[
'cartUrl'
]);
}
if
(
$this
->
isAjax
())
{
// 限购商品支付接口返回为空或错误时(异步请求)
// 限购商品支付接口返回为空或错误时(异步请求)
if
(
$isAjax
)
{
$this
->
echoJson
(
$order
);
return
;
}
...
...
Please
register
or
login
to post a comment