作者 李忠强

更新

@@ -63,7 +63,7 @@ class Buy extends Api @@ -63,7 +63,7 @@ class Buy extends Api
63 */ 63 */
64 public function priceCalculation() 64 public function priceCalculation()
65 { 65 {
66 - $json = $this->request->post('data_json'); 66 + $json = $this->request->param('data_json');
67 if (!$json) $this->error('data_json参数不能为空'); 67 if (!$json) $this->error('data_json参数不能为空');
68 $data = json_decode($json,true); 68 $data = json_decode($json,true);
69 $goodsmodel = new \app\api\model\Goods(); 69 $goodsmodel = new \app\api\model\Goods();
@@ -202,8 +202,7 @@ class Cart extends Api @@ -202,8 +202,7 @@ class Cart extends Api
202 */ 202 */
203 public function priceCalculation() 203 public function priceCalculation()
204 { 204 {
205 - $json = $this->request->param();  
206 - var_dump($json);exit(); 205 + $json = $this->request->param('data_json');
207 if (!$json) $this->error('data_json参数不能为空'); 206 if (!$json) $this->error('data_json参数不能为空');
208 // $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}]';
209 $data = json_decode($json,true); 208 $data = json_decode($json,true);
@@ -175,7 +175,7 @@ class Order extends Api @@ -175,7 +175,7 @@ class Order extends Api
175 */ 175 */
176 public function orderCalculation() 176 public function orderCalculation()
177 { 177 {
178 - $json = $this->request->post('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 = '[{"goods_id":22,"goods_sku_id":106,"number":2},{"goods_id":23,"goods_sku_id":66,"number":2}]'; 180 // $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); 181 $data = json_decode($json,true);
@@ -364,9 +364,9 @@ class Order extends Api @@ -364,9 +364,9 @@ class Order extends Api
364 */ 364 */
365 public function addOrder() 365 public function addOrder()
366 { 366 {
367 - $json = $this->request->post('data_json');  
368 - $coupon_id = $this->request->post('coupon_id');  
369 - $address_id = $this->request->post('address_id'); 367 + $json = $this->request->param('data_json');
  368 + $coupon_id = $this->request->param('coupon_id');
  369 + $address_id = $this->request->param('address_id');
370 if (!$json) $this->error('data_json参数不能为空'); 370 if (!$json) $this->error('data_json参数不能为空');
371 // $json = '[{"goods_id":22,"goods_sku_id":106,"number":2},{"goods_id":23,"goods_sku_id":66,"number":2}]'; 371 // $json = '[{"goods_id":22,"goods_sku_id":106,"number":2},{"goods_id":23,"goods_sku_id":66,"number":2}]';
372 $address = Db::name('user_address') 372 $address = Db::name('user_address')