修复收藏的商品以及品牌页面价格格式错误的bug
Code Review By Rock Zhang
Showing
1 changed file
with
6 additions
and
6 deletions
@@ -202,9 +202,9 @@ class UserModel | @@ -202,9 +202,9 @@ class UserModel | ||
202 | $product['imgUrl'] = !empty($val['image']) ? Helpers::getImageUrl($val['image'], 447, 596) : ''; | 202 | $product['imgUrl'] = !empty($val['image']) ? Helpers::getImageUrl($val['image'], 447, 596) : ''; |
203 | ; | 203 | ; |
204 | $product['title'] = $val['product_name']; | 204 | $product['title'] = $val['product_name']; |
205 | - $product['price'] = !empty($val['market_price']) ? '¥' . $val['market_price'] . '.00' : 0; | ||
206 | - $product['discountPrice'] = ($val['market_price'] - $val['sales_price'] > 0) ? '¥' . $val['sales_price'] . '.00' : false; | ||
207 | - $product['savePrice'] = ($val['price_down'] > 0) ? '¥' . $val['price_down'] . '.00' : false; | 205 | + $product['price'] = '¥' . Helpers::transPrice($val['market_price']); |
206 | + $product['discountPrice'] = ($val['market_price'] - $val['sales_price'] > 0) ? '¥' . Helpers::transPrice($val['sales_price']) : false; | ||
207 | + $product['savePrice'] = ($val['price_down'] > 0) ? '¥' . Helpers::transPrice($val['price_down']) : false; | ||
208 | $product['sellOut'] = ($val['storage'] <= 0); | 208 | $product['sellOut'] = ($val['storage'] <= 0); |
209 | 209 | ||
210 | $datas[] = $product; | 210 | $datas[] = $product; |
@@ -256,8 +256,8 @@ class UserModel | @@ -256,8 +256,8 @@ class UserModel | ||
256 | $product = array(); | 256 | $product = array(); |
257 | $product['link'] = isset($one['goods'][0], $one['cnAlphabet']) ? Helpers::url('/product/pro_' . $one['product_id'] . '_' . $one['goods'][0]['id'] . '/' . $one['cnAlphabet'] . '.html') : ''; | 257 | $product['link'] = isset($one['goods'][0], $one['cnAlphabet']) ? Helpers::url('/product/pro_' . $one['product_id'] . '_' . $one['goods'][0]['id'] . '/' . $one['cnAlphabet'] . '.html') : ''; |
258 | $product['imgUrl'] = (isset($one['default_images']) && !empty($one['default_images'])) ? Images::getImageUrl($one['default_images'], 235, 314) : ''; | 258 | $product['imgUrl'] = (isset($one['default_images']) && !empty($one['default_images'])) ? Images::getImageUrl($one['default_images'], 235, 314) : ''; |
259 | - $product['price'] = !empty($one['market_price']) ? '¥' . $one['market_price'] : 0; | ||
260 | - $product['discount'] = ($one['market_price'] > $one['sales_price']) ? '¥' . $one['sales_price'] : false; | 259 | + $product['price'] = '¥' . Helpers::transPrice($one['market_price']); |
260 | + $product['discount'] = ($one['market_price'] > $one['sales_price']) ? '¥' . Helpers::transPrice($one['sales_price']) : false; | ||
261 | 261 | ||
262 | $brand['productList'][] = $product; | 262 | $brand['productList'][] = $product; |
263 | } | 263 | } |
@@ -321,7 +321,7 @@ class UserModel | @@ -321,7 +321,7 @@ class UserModel | ||
321 | $val['link'] = Helpers::url('/product/show_' . $val['product_skn'] . '.html'); | 321 | $val['link'] = Helpers::url('/product/show_' . $val['product_skn'] . '.html'); |
322 | $val['image'] = !empty($val['image']) ? Helpers::getImageUrl($val['image'], 447, 596) : ''; | 322 | $val['image'] = !empty($val['image']) ? Helpers::getImageUrl($val['image'], 447, 596) : ''; |
323 | $val['sales_price'] = Helpers::transPrice($val['sales_price']); | 323 | $val['sales_price'] = Helpers::transPrice($val['sales_price']); |
324 | - $val['market_price'] = ($val['market_price'] - $val['sales_price'] > 0) ? $val['market_price'] . '.00' : false; | 324 | + $val['market_price'] = ($val['market_price'] - $val['sales_price'] > 0) ? Helpers::transPrice($val['market_price']) : false; |
325 | } | 325 | } |
326 | !empty($data) && $result['browseRecord'] = $data; | 326 | !empty($data) && $result['browseRecord'] = $data; |
327 | } | 327 | } |
-
Please register or login to post a comment