作者 李忠强

更新

... ... @@ -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('参数不合法');
... ...