正在显示
3 个修改的文件
包含
5 行增加
和
4 行删除
@@ -65,6 +65,7 @@ class Buy extends Api | @@ -65,6 +65,7 @@ class Buy extends Api | ||
65 | { | 65 | { |
66 | $json = $this->request->param('data_json'); | 66 | $json = $this->request->param('data_json'); |
67 | if (!$json) $this->error('data_json参数不能为空'); | 67 | if (!$json) $this->error('data_json参数不能为空'); |
68 | + $json = str_replace('&qout;','"',$json); | ||
68 | $data = json_decode($json,true); | 69 | $data = json_decode($json,true); |
69 | $goodsmodel = new \app\api\model\Goods(); | 70 | $goodsmodel = new \app\api\model\Goods(); |
70 | $skumodel = new GoodsSpec(); | 71 | $skumodel = new GoodsSpec(); |
@@ -203,11 +203,10 @@ class Cart extends Api | @@ -203,11 +203,10 @@ class Cart extends Api | ||
203 | public function priceCalculation() | 203 | public function priceCalculation() |
204 | { | 204 | { |
205 | $json = $this->request->param('data_json'); | 205 | $json = $this->request->param('data_json'); |
206 | -// if (!$json) $this->error('data_json参数不能为空'); | 206 | + if (!$json) $this->error('data_json参数不能为空'); |
207 | // $json = '[{"goods_id":22,"goods_sku_id":106,"number":2},{"goods_id":23,"goods_sku_id":66,"number":2}]'; | 207 | // $json = '[{"goods_id":22,"goods_sku_id":106,"number":2},{"goods_id":23,"goods_sku_id":66,"number":2}]'; |
208 | + $json = str_replace('&qout;','"',$json); | ||
208 | $data = json_decode($json,true); | 209 | $data = json_decode($json,true); |
209 | - var_dump($json); | ||
210 | - var_dump($data);exit(); | ||
211 | $goodsmodel = new \app\api\model\Goods(); | 210 | $goodsmodel = new \app\api\model\Goods(); |
212 | $skumodel = new GoodsSpec(); | 211 | $skumodel = new GoodsSpec(); |
213 | $sum_price = 0; //总价格 | 212 | $sum_price = 0; //总价格 |
@@ -177,6 +177,7 @@ class Order extends Api | @@ -177,6 +177,7 @@ class Order extends Api | ||
177 | { | 177 | { |
178 | $json = $this->request->param('data_json'); | 178 | $json = $this->request->param('data_json'); |
179 | if (!$json) $this->error('data_json参数不能为空'); | 179 | if (!$json) $this->error('data_json参数不能为空'); |
180 | + $json = str_replace('&qout;','"',$json); | ||
180 | // $json = '[{"goods_id":22,"goods_sku_id":106,"number":2},{"goods_id":23,"goods_sku_id":66,"number":2}]'; | 181 | // $json = '[{"goods_id":22,"goods_sku_id":106,"number":2},{"goods_id":23,"goods_sku_id":66,"number":2}]'; |
181 | $data = json_decode($json,true); | 182 | $data = json_decode($json,true); |
182 | $goodsmodel = new \app\api\model\Goods(); | 183 | $goodsmodel = new \app\api\model\Goods(); |
@@ -382,7 +383,7 @@ class Order extends Api | @@ -382,7 +383,7 @@ class Order extends Api | ||
382 | ->find(); | 383 | ->find(); |
383 | if (!$coupon) $this->error('优惠券不存在'); | 384 | if (!$coupon) $this->error('优惠券不存在'); |
384 | } | 385 | } |
385 | - | 386 | + $json = str_replace('&qout;','"',$json); |
386 | $data = json_decode($json,true); | 387 | $data = json_decode($json,true); |
387 | $goodsmodel = new \app\api\model\Goods(); | 388 | $goodsmodel = new \app\api\model\Goods(); |
388 | $skumodel = new GoodsSpec(); | 389 | $skumodel = new GoodsSpec(); |
-
请 注册 或 登录 后发表评论