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
a6323f41880ba7636d81d7a9089d3142797e384e
1 parent
7f7cb487
过滤掉订单详情页中yoho币,活动价,优惠券为0的情况,默认不显示
Code Review By Rock Zhang
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
3 deletions
template/m.yohobuy.com/actions/index/home/order-detail.phtml
yohobuy/m.yohobuy.com/application/models/Home/Order.php
template/m.yohobuy.com/actions/index/home/order-detail.phtml
View file @
a6323f4
...
...
@@ -50,22 +50,28 @@
商品总金额
<span>
{
{sumPrice
}
}</span>
</li>
{
{#if
salePrice
}
}
<li>
活动金额
<span>
{
{salePrice
}
}</span>
</li>
{
{/if
}
}
<li>
运费
<span>
{
{freight
}
}</span>
</li>
{
{#if
coupon
}
}
<li>
优惠券
<span>
{
{coupon
}
}</span>
</li>
{
{/if
}
}
{
{#if
yohoCoin
}
}
<li>
YOHO币
<span>
{
{yohoCoin
}
}</span>
</li>
{
{/if
}
}
<li>
实付金额
<span>
{
{price
}
}</span>
...
...
yohobuy/m.yohobuy.com/application/models/Home/Order.php
View file @
a6323f4
...
...
@@ -145,10 +145,10 @@ class OrderModel
$result
[
'orderTime'
]
=
date
(
'Y-m-d H:i:s'
,
$orderDetail
[
'data'
][
'create_time'
]);
$result
[
'goods'
]
=
Helpers
::
formatOrderGoods
(
$orderDetail
[
'data'
][
'order_goods'
],
$count
,
true
);
$result
[
'sumPrice'
]
=
$orderDetail
[
'data'
][
'goods_total_amount'
];
// 商品总金额
$result
[
'salePrice'
]
=
$orderDetail
[
'data'
][
'promotion_amount'
]
;
// 活动金额
$result
[
'salePrice'
]
=
self
::
filterOrderPrice
(
$orderDetail
[
'data'
][
'promotion_amount'
])
;
// 活动金额
$result
[
'freight'
]
=
$orderDetail
[
'data'
][
'shipping_cost'
];
// 运费
$result
[
'coupon'
]
=
$orderDetail
[
'data'
][
'coupons_amount'
];
// 优惠券
$result
[
'yohoCoin'
]
=
$orderDetail
[
'data'
][
'yoho_coin_num'
];
// YOHO币
$result
[
'coupon'
]
=
self
::
filterOrderPrice
(
$orderDetail
[
'data'
][
'coupons_amount'
]);
// 优惠券
$result
[
'yohoCoin'
]
=
self
::
filterOrderPrice
(
$orderDetail
[
'data'
][
'yoho_coin_num'
]);
// YOHO币
$result
[
'price'
]
=
$orderDetail
[
'data'
][
'amount'
];
// 实付金额
$result
[
'goodsAmount'
]
=
$orderDetail
[
'data'
][
'payment_amount'
];
// 商品总金额没有人民币符号
$result
[
'orderCount'
]
=
$count
;
// 订单总件数
...
...
@@ -267,4 +267,15 @@ class OrderModel
return
$result
;
}
/**
* 过滤掉为0的价格数据
*
* @param $price
* @return string 过滤之后的价格
*/
private
static
function
filterOrderPrice
(
$price
)
{
return
empty
(
intval
(
preg_replace
(
'/[+|\-|¥]/s'
,
''
,
$price
)))
?
''
:
$price
;
}
}
...
...
Please
register
or
login
to post a comment