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
5ba0b492b8dd24b245dfd4d71def4719ab0ed64f
1 parent
7ba2c5a4
修复收藏的商品以及品牌图片和价格显示的bug
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
yohobuy/m.yohobuy.com/application/models/Index/User.php
yohobuy/m.yohobuy.com/application/models/Index/User.php
View file @
5ba0b49
...
...
@@ -180,16 +180,16 @@ class UserModel
$datas
=
array
();
$product
=
array
();
foreach
(
$favProduct
[
'data'
][
'product_list'
]
as
$val
)
{
$product
=
array
();
$product
[
'fav_id'
]
=
$val
[
'product_id'
];
$product
[
'imgUrl'
]
=
$val
[
'image'
];
$product
[
'link'
]
=
Helpers
::
url
(
'/product/pro_'
.
$val
[
'product_skn'
]
.
'_'
.
$val
[
'goodsId'
]
.
'/'
.
$val
[
'cnAlphabet'
]
.
'.html'
);
$product
[
'imgUrl'
]
=
Helpers
::
getImageUrl
(
$val
[
'image'
],
447
,
596
);;
$product
[
'title'
]
=
$val
[
'product_name'
];
$product
[
'price'
]
=
!
empty
(
$val
[
'market_price'
])
?
'¥'
.
$val
[
'market_price'
]
.
'.00'
:
0
;
$product
[
'discountPrice'
]
=
(
$val
[
'market_price'
]
-
$val
[
'sales_price'
]
>
0
)
?
'¥'
.
$val
[
'sales_price'
]
.
'.00'
:
false
;
$product
[
'savePrice'
]
=
(
$val
[
'market_price'
]
-
$val
[
'sales_price'
]
>
0
)
?
'¥'
.
(
$val
[
'market_price'
]
-
$val
[
'sales_price'
])
.
'.00'
:
false
;
$product
[
'sellOut'
]
=
(
bool
)(
$val
[
'price_down'
]);
$product
[
'savePrice'
]
=
!
empty
(
$val
[
'price_down'
]
>
0
)
?
'¥'
.
$val
[
'price_down'
]
.
'.00'
:
false
;
$product
[
'sellOut'
]
=
(
$val
[
'storage'
]
<=
0
);
$datas
[]
=
$product
;
}
...
...
@@ -230,19 +230,19 @@ class UserModel
foreach
(
$favBrand
[
'data'
][
'brand_list'
]
as
$val
)
{
$brand
=
array
();
$brand
[
'id'
]
=
$val
[
'brand_id'
];
$brand
[
'brandImg'
]
=
Images
::
getImageUrl
(
$val
[
'brand_ico'
],
235
,
314
)
;
$brand
[
'brandImg'
]
=
!
empty
(
$val
[
'brand_ico'
])
?
Images
::
getImageUrl
(
$val
[
'brand_ico'
],
235
,
314
)
:
''
;
$brand
[
'brandName'
]
=
$val
[
'brand_name'
];
$brand
[
'update'
]
=
$val
[
'new_product_num'
];
$brand
[
'discount'
]
=
$val
[
'product_discount_num'
];
$brand
[
'link'
]
=
'#'
;
$brand
[
'link'
]
=
Helpers
::
url
(
''
,
array
(
'query'
=>
$val
[
'brand_name'
]),
'search'
)
;
// 处理品牌产品
$product
=
array
();
foreach
(
$val
[
'new_product'
]
as
$one
)
{
$product
=
array
();
$product
[
'imgUrl'
]
=
Images
::
getImageUrl
(
$one
[
'default_images'
],
235
,
314
);
$product
[
'price'
]
=
'¥'
.
$one
[
'market_price'
];
$product
[
'discount'
]
=
'¥'
.
$one
[
'sales_price'
];
$product
[
'price'
]
=
!
empty
(
$one
[
'market_price'
])
?
'¥'
.
$one
[
'market_price'
]
.
'.00'
:
0
;
$product
[
'discount'
]
=
!
empty
(
$one
[
'sales_price'
])
?
'¥'
.
$one
[
'sales_price'
]
.
'.00'
:
0
;
$brand
[
'productList'
][]
=
$product
;
}
...
...
Please
register
or
login
to post a comment