Authored by Rock Zhang

'修复浏览记录中商品价格返回带小数位时的显示”

Code Review By Rock Zhang
... ... @@ -302,8 +302,8 @@ class UserModel
foreach ($data as &$val) {
$val['link'] = isset($val['goodsId']) ? Helpers::url('/product/pro_' . $val['product_skn'] . '_' . $val['goodsId'] . '/' . $val['cnAlphabet'] . '.html') : '';
$val['image'] = !empty($val['image']) ? Helpers::getImageUrl($val['image'], 447, 596) : '';
$val['sales_price'] = !empty($val['sales_price']) ? $val['sales_price'] . '.00' : 0;
$val['market_price'] = ($val['market_price'] - $val['sales_price'] > 0) ? $val['market_price'] . '.00' : false;
$val['sales_price'] = (!empty($val['sales_price']) && !is_float($val['sales_price'])) ? $val['sales_price'] . '.00' : 0;
$val['market_price'] = (($val['market_price'] - $val['sales_price'] > 0) && !is_float($val['market_price'])) ? $val['market_price'] . '.00' : false;
}
!empty($data) && $result['browseRecord'] = $data;
}
... ...