修复收藏的商品以及品牌图片和价格显示的bug
Showing
1 changed file
with
8 additions
and
8 deletions
@@ -180,16 +180,16 @@ class UserModel | @@ -180,16 +180,16 @@ class UserModel | ||
180 | 180 | ||
181 | $datas = array(); | 181 | $datas = array(); |
182 | $product = array(); | 182 | $product = array(); |
183 | - | ||
184 | foreach ($favProduct['data']['product_list'] as $val) { | 183 | foreach ($favProduct['data']['product_list'] as $val) { |
185 | $product = array(); | 184 | $product = array(); |
186 | $product['fav_id'] = $val['product_id']; | 185 | $product['fav_id'] = $val['product_id']; |
187 | - $product['imgUrl'] = $val['image']; | 186 | + $product['link'] = Helpers::url('/product/pro_' . $val['product_skn'] . '_' . $val['goodsId'] . '/' . $val['cnAlphabet'] . '.html'); |
187 | + $product['imgUrl'] = Helpers::getImageUrl($val['image'], 447, 596);; | ||
188 | $product['title'] = $val['product_name']; | 188 | $product['title'] = $val['product_name']; |
189 | $product['price'] = !empty($val['market_price']) ? '¥'.$val['market_price'] . '.00' : 0; | 189 | $product['price'] = !empty($val['market_price']) ? '¥'.$val['market_price'] . '.00' : 0; |
190 | $product['discountPrice'] = ($val['market_price'] - $val['sales_price'] > 0) ? '¥' . $val['sales_price'] . '.00' : false; | 190 | $product['discountPrice'] = ($val['market_price'] - $val['sales_price'] > 0) ? '¥' . $val['sales_price'] . '.00' : false; |
191 | - $product['savePrice'] = ($val['market_price'] - $val['sales_price'] > 0) ? '¥'.($val['market_price'] - $val['sales_price']) . '.00' : false; | ||
192 | - $product['sellOut'] = (bool)($val['price_down']); | 191 | + $product['savePrice'] = !empty($val['price_down'] > 0) ? '¥'.$val['price_down'] . '.00' : false; |
192 | + $product['sellOut'] = ($val['storage'] <= 0); | ||
193 | 193 | ||
194 | $datas[] = $product; | 194 | $datas[] = $product; |
195 | } | 195 | } |
@@ -230,19 +230,19 @@ class UserModel | @@ -230,19 +230,19 @@ class UserModel | ||
230 | foreach ($favBrand['data']['brand_list'] as $val) { | 230 | foreach ($favBrand['data']['brand_list'] as $val) { |
231 | $brand = array(); | 231 | $brand = array(); |
232 | $brand['id'] = $val['brand_id']; | 232 | $brand['id'] = $val['brand_id']; |
233 | - $brand['brandImg'] = Images::getImageUrl($val['brand_ico'], 235, 314); | 233 | + $brand['brandImg'] = !empty($val['brand_ico']) ? Images::getImageUrl($val['brand_ico'], 235, 314) : ''; |
234 | $brand['brandName'] = $val['brand_name']; | 234 | $brand['brandName'] = $val['brand_name']; |
235 | $brand['update'] = $val['new_product_num']; | 235 | $brand['update'] = $val['new_product_num']; |
236 | $brand['discount'] = $val['product_discount_num']; | 236 | $brand['discount'] = $val['product_discount_num']; |
237 | - $brand['link'] = '#'; | 237 | + $brand['link'] = Helpers::url('', array('query' => $val['brand_name']), 'search'); |
238 | 238 | ||
239 | // 处理品牌产品 | 239 | // 处理品牌产品 |
240 | $product = array(); | 240 | $product = array(); |
241 | foreach ($val['new_product'] as $one) { | 241 | foreach ($val['new_product'] as $one) { |
242 | $product = array(); | 242 | $product = array(); |
243 | $product['imgUrl'] = Images::getImageUrl($one['default_images'], 235, 314); | 243 | $product['imgUrl'] = Images::getImageUrl($one['default_images'], 235, 314); |
244 | - $product['price'] = '¥'.$one['market_price']; | ||
245 | - $product['discount'] = '¥'.$one['sales_price']; | 244 | + $product['price'] = !empty($one['market_price']) ? '¥'.$one['market_price'] . '.00' : 0; |
245 | + $product['discount'] = !empty($one['sales_price']) ? '¥'.$one['sales_price'] . '.00' : 0; | ||
246 | 246 | ||
247 | $brand['productList'][] = $product; | 247 | $brand['productList'][] = $product; |
248 | } | 248 | } |
-
Please register or login to post a comment