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
567d5a0ad63191bc4a81ece132c258f8d9362775
1 parent
16b31e02
修复结算页中价格为0时不显示为0.00的bug
Code Review By Rock Zhang
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
3 deletions
library/Plugin/Helpers.php
yohobuy/m.yohobuy.com/application/models/Index/Cart.php
library/Plugin/Helpers.php
View file @
567d5a0
...
...
@@ -186,11 +186,12 @@ class Helpers
* 转换价格
*
* @param float|string $price 价格
* @param boolean $isSepcialZero 是否需要特殊的0,默认否
* @return float|string 转换之后的价格
*/
public
static
function
transPrice
(
$price
)
public
static
function
transPrice
(
$price
,
$isSepcialZero
=
false
)
{
return
!
empty
(
$price
)
?
number_format
(
$price
,
2
,
'.'
,
''
)
:
0
;
return
(
!
empty
(
$price
)
||
$isSepcialZero
)
?
number_format
(
$price
,
2
,
'.'
,
''
)
:
0
;
}
/**
...
...
yohobuy/m.yohobuy.com/application/models/Index/Cart.php
View file @
567d5a0
...
...
@@ -518,7 +518,7 @@ 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
);
$result
[
'price'
]
=
Helpers
::
transPrice
(
$price
,
true
);
// 订单商品数
$result
[
'num'
]
=
$payReturn
[
'shopping_cart_data'
][
'selected_goods_count'
];
// 商品金额
...
...
Please
register
or
login
to post a comment