作者 SHW\戥岁。。

金额格式化

@@ -58,8 +58,8 @@ class Goods extends Api @@ -58,8 +58,8 @@ class Goods extends Api
58 } 58 }
59 $goods = $goodsmodel::get($goods_id); 59 $goods = $goodsmodel::get($goods_id);
60 $goods_spec = Db::name('litestore_goods_spec')->where('goods_id', $goods['goods_id'])->find(); 60 $goods_spec = Db::name('litestore_goods_spec')->where('goods_id', $goods['goods_id'])->find();
61 - $goods['price'] = round($goods_spec['goods_price'], 2);  
62 - $goods['line_price'] = round($goods_spec['line_price'], 2); 61 + $goods['price'] = $goods_spec['goods_price'];
  62 + $goods['line_price'] = $goods_spec['line_price'];
63 //判断是否打折 63 //判断是否打折
64 $goods['is_discount'] = 'is'; 64 $goods['is_discount'] = 'is';
65 if ($goods_spec['goods_price'] == $goods_spec['line_price']) { 65 if ($goods_spec['goods_price'] == $goods_spec['line_price']) {
@@ -150,8 +150,6 @@ class Goods extends Api @@ -150,8 +150,6 @@ class Goods extends Api
150 } 150 }
151 $goods_spec = GoodsSpec::all(['goods_id' => $goods_id]); 151 $goods_spec = GoodsSpec::all(['goods_id' => $goods_id]);
152 foreach ($goods_spec as &$value) { 152 foreach ($goods_spec as &$value) {
153 - $value['goods_price'] = round($value['goods_price'], 2);  
154 - $value['line_price'] = round($value['line_price'], 2);  
155 //判断是否打折 153 //判断是否打折
156 $value['is_discount'] = 'is'; 154 $value['is_discount'] = 'is';
157 if ($value['goods_price'] == $value['line_price']) { 155 if ($value['goods_price'] == $value['line_price']) {