From c1c04636ec61f4c086c20f97046c607aa017aa51 Mon Sep 17 00:00:00 2001 From: 李忠强 <1354905998@qq.com> Date: Fri, 21 Jan 2022 18:27:45 +0800 Subject: [PATCH] 更新 --- application/api/controller/Cart.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/application/api/controller/Cart.php b/application/api/controller/Cart.php index 8bb3199..f761d1d 100644 --- a/application/api/controller/Cart.php +++ b/application/api/controller/Cart.php @@ -202,13 +202,14 @@ class Cart extends Api */ public function priceCalculation() { - $json = $this->request->post('data_json'); + $json = $_POST['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}]'; $data = json_decode($json,true); $goodsmodel = new \app\api\model\Goods(); $skumodel = new GoodsSpec(); $sum_price = 0; //总价格 + var_dump($data);exit(); foreach ($data as $key => $value){ if (!is_numeric($value['goods_id']) || !is_numeric($value['goods_sku_id']) || !is_numeric($value['number'])){ $this->error('参数不合法'); -- libgit2 0.24.0