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
28fd6b6aa3c9bd04b01fd652e1e026162f9b0b95
1 parent
5af94d2e
去除个人中心下面的推荐商品中的小数位
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
4 deletions
library/Plugin/Helpers.php
yohobuy/m.yohobuy.com/application/models/Index/User.php
library/Plugin/Helpers.php
View file @
28fd6b6
...
...
@@ -178,9 +178,10 @@ class Helpers
* @param int $width 图片的宽度
* @param int $height 图片的高度
* @param bool $isApp 判断是不是APP访问
* @param bool $showPoint 商品价格是否显示小数位,默认显示
* @return array | false
*/
public
static
function
formatProduct
(
$productData
,
$showTags
=
true
,
$showNew
=
true
,
$showSale
=
true
,
$width
=
290
,
$height
=
388
,
$isApp
=
false
)
public
static
function
formatProduct
(
$productData
,
$showTags
=
true
,
$showNew
=
true
,
$showSale
=
true
,
$width
=
290
,
$height
=
388
,
$isApp
=
false
,
$showPoint
=
true
)
{
// 商品信息有问题,则不显示
if
(
!
isset
(
$productData
[
'product_skn'
])
||
!
isset
(
$productData
[
'goods_list'
][
0
]))
{
...
...
@@ -202,8 +203,12 @@ class Helpers
$result
[
'product_id'
]
=
$productData
[
'product_id'
];
$result
[
'thumb'
]
=
Images
::
getImageUrl
(
$productData
[
'default_images'
],
$width
,
$height
);
$result
[
'name'
]
=
$productData
[
'product_name'
];
$result
[
'price'
]
=
empty
(
$productData
[
'market_price'
])
?
false
:
$productData
[
'market_price'
]
.
'.00'
;
$result
[
'salePrice'
]
=
$productData
[
'sales_price'
]
.
'.00'
;
$result
[
'price'
]
=
empty
(
$productData
[
'market_price'
])
?
false
:
$productData
[
'market_price'
];
$result
[
'salePrice'
]
=
$productData
[
'sales_price'
];
if
(
$showPoint
)
{
$result
[
'price'
]
&&
$result
[
'price'
]
.=
'.00'
;
$result
[
'salePrice'
]
&&
$result
[
'salePrice'
]
.=
'.00'
;
}
$result
[
'is_soon_sold_out'
]
=
(
$productData
[
'is_soon_sold_out'
]
===
'Y'
);
$result
[
'url'
]
=
SITE_MAIN
.
'/product/pro_'
.
$productData
[
'product_id'
]
.
'_'
.
$productData
[
'goods_list'
][
0
][
'goods_id'
]
...
...
yohobuy/m.yohobuy.com/application/models/Index/User.php
View file @
28fd6b6
...
...
@@ -85,7 +85,7 @@ class UserModel
// 处理个人中心页面优选新品数据
if
(
isset
(
$preferenceData
[
'data'
])
&&
!
empty
(
$preferenceData
[
'data'
]))
{
foreach
(
$preferenceData
[
'data'
]
as
$val
)
{
$result
[
'recommendList'
][]
=
Helpers
::
formatProduct
(
$val
,
false
);
$result
[
'recommendList'
][]
=
Helpers
::
formatProduct
(
$val
,
false
,
true
,
true
,
299
,
388
,
false
,
false
);
}
}
...
...
Please
register
or
login
to post a comment