From deb8c43a58b435f1ed1a2ebe0c6dd5e446191946 Mon Sep 17 00:00:00 2001 From: 李忠强 <1354905998@qq.com> Date: Fri, 21 Jan 2022 18:50:56 +0800 Subject: [PATCH] 更新 --- application/api/controller/Buy.php | 1 + application/api/controller/Cart.php | 5 ++--- application/api/controller/Order.php | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/application/api/controller/Buy.php b/application/api/controller/Buy.php index 4808080..67bbe38 100644 --- a/application/api/controller/Buy.php +++ b/application/api/controller/Buy.php @@ -65,6 +65,7 @@ class Buy extends Api { $json = $this->request->param('data_json'); if (!$json) $this->error('data_json参数不能为空'); + $json = str_replace('&qout;','"',$json); $data = json_decode($json,true); $goodsmodel = new \app\api\model\Goods(); $skumodel = new GoodsSpec(); diff --git a/application/api/controller/Cart.php b/application/api/controller/Cart.php index aa3110e..474599a 100644 --- a/application/api/controller/Cart.php +++ b/application/api/controller/Cart.php @@ -203,11 +203,10 @@ class Cart extends Api public function priceCalculation() { $json = $this->request->param('data_json'); -// if (!$json) $this->error('data_json参数不能为空'); + if (!$json) $this->error('data_json参数不能为空'); // $json = '[{"goods_id":22,"goods_sku_id":106,"number":2},{"goods_id":23,"goods_sku_id":66,"number":2}]'; + $json = str_replace('&qout;','"',$json); $data = json_decode($json,true); - var_dump($json); - var_dump($data);exit(); $goodsmodel = new \app\api\model\Goods(); $skumodel = new GoodsSpec(); $sum_price = 0; //总价格 diff --git a/application/api/controller/Order.php b/application/api/controller/Order.php index 8304602..07bd55e 100644 --- a/application/api/controller/Order.php +++ b/application/api/controller/Order.php @@ -177,6 +177,7 @@ class Order extends Api { $json = $this->request->param('data_json'); if (!$json) $this->error('data_json参数不能为空'); + $json = str_replace('&qout;','"',$json); // $json = '[{"goods_id":22,"goods_sku_id":106,"number":2},{"goods_id":23,"goods_sku_id":66,"number":2}]'; $data = json_decode($json,true); $goodsmodel = new \app\api\model\Goods(); @@ -382,7 +383,7 @@ class Order extends Api ->find(); if (!$coupon) $this->error('优惠券不存在'); } - + $json = str_replace('&qout;','"',$json); $data = json_decode($json,true); $goodsmodel = new \app\api\model\Goods(); $skumodel = new GoodsSpec(); -- libgit2 0.24.0