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
008a600e19bf0b77b245cbdf1e58285fa6a3815a
1 parent
3568bb9f
修复购物车结算页选择优惠券中优惠券是否可用的判定逻辑(通过php去过滤掉不可用的优惠券)
但那种免邮券还是不能用 Code Review By Rock Zhang
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
11 deletions
static/js/cart/order-ensure.js
template/m.yohobuy.com/actions/cart/index/order-ensure.phtml
yohobuy/m.yohobuy.com/application/models/Index/Cart.php
static/js/cart/order-ensure.js
View file @
008a600
...
...
@@ -95,12 +95,13 @@ function orderCompute() {
}
if (res.discount_amount) {
res.discount_amount = (+res.discount_amount).toFixed(2);
}
}
*/
if
(
res
.
last_order_amount
)
{
res
.
last_order_amount
=
(
+
res
.
last_order_amount
).
toFixed
(
2
);
}
*/
}
priceHtml
=
priceTmpl
({
cartPayData
:
res
.
promotion_formula_list
cartPayData
:
res
.
promotion_formula_list
,
price
:
res
.
last_order_amount
});
$price
.
html
(
priceHtml
);
...
...
template/m.yohobuy.com/actions/cart/index/order-ensure.phtml
View file @
008a600
...
...
@@ -104,6 +104,9 @@
{
{promotion_amount
}
}
</li>
{
{/cartPayData
}
}
<li
class=
"cost"
>
应付金额:
<em>¥
{
{price
}
}</em>
</li>
</ul>
</section>
...
...
@@ -131,6 +134,9 @@
\
{
{promotion_amount
}
}
</li>
\
{
{/cartPayData
}
}
<li
class=
"cost"
>
应付金额:
<em>¥\
{
{price
}
}</em>
</li>
</ul>
</script>
{
{>
layout/footer
}
}
...
...
yohobuy/m.yohobuy.com/application/models/Index/Cart.php
View file @
008a600
...
...
@@ -451,6 +451,8 @@ class CartModel
// 订单数据
if
(
isset
(
$payReturn
[
'shopping_cart_data'
])
&&
!
empty
(
$payReturn
[
'shopping_cart_data'
]))
{
$result
[
'cartPayData'
]
=
isset
(
$orderCompute
[
'promotion_formula_list'
])
?
$orderCompute
[
'promotion_formula_list'
]
:
$payReturn
[
'shopping_cart_data'
][
'promotion_formula_list'
];
$price
=
isset
(
$orderCompute
[
'last_order_amount'
])
?
$orderCompute
[
'last_order_amount'
]
:
$payReturn
[
'shopping_cart_data'
][
'last_order_amount'
];
$result
[
'price'
]
=
Helpers
::
transPrice
(
$price
);
/*$sumPrice = isset($orderCompute['order_amount']) ? $orderCompute['order_amount'] : $payReturn['shopping_cart_data']['order_amount'];
...
...
@@ -569,17 +571,21 @@ class CartModel
$coupons
=
CartData
::
getCouponList
(
$uid
);
do
{
if
(
$onlyTotal
)
{
$result
[
'count'
]
=
count
(
$coupons
[
'data'
][
'couponList'
]);
break
;
}
if
(
isset
(
$coupons
[
'data'
][
'couponList'
]))
{
foreach
(
$coupons
[
'data'
][
'couponList'
]
as
&
$val
)
{
$val
[
'notAvailable'
]
=
$val
[
'isValidity'
]
===
'N'
;
foreach
(
$coupons
[
'data'
][
'couponList'
]
as
$val
)
{
$notAvailableRes
=
self
::
searchCoupon
(
$uid
,
$val
[
'couponCode'
]);
// 处理可用的优惠券
if
(
$val
[
'isValidity'
]
===
'N'
||
(
isset
(
$notAvailableRes
[
'code'
])
&&
$notAvailableRes
[
'code'
]
!==
200
))
{
// $val['notAvailable'] = true;
continue
;
}
$result
[]
=
$val
;
}
}
$result
=
$coupons
[
'data'
][
'couponList'
];
if
(
$onlyTotal
)
{
$count
=
count
(
$result
);
$result
=
array
(
'count'
=>
$count
);
}
}
while
(
0
);
...
...
Please
register
or
login
to post a comment