作者 李忠强

更新

... ... @@ -128,7 +128,7 @@ class Buy extends Api
$model = new \app\api\model\UserBuylist();
$order = $model->with('sku')->where('id',$id)->find();
if ($number+$order['number'] > $order['stock_num']) $this->error('已达到最大库存,请勿重复提交');
if ($number+$order['number'] > $order['sku']['stock_num']) $this->error('已达到最大库存,请勿重复提交');
$model->where('id',$id)->setInc('number',$number);
$this->success('SUCCESS');
}
... ...
... ... @@ -97,7 +97,7 @@ class Cart extends Api
$model = new \app\api\model\Cart();
$order = $model->with('sku')->where('id',$id)->find();
if ($number+$order['number'] > $order['stock_num']) $this->error('已达到最大库存,请勿重复提交');
if ($number+$order['number'] > $order['sku']['stock_num']) $this->error('已达到最大库存,请勿重复提交');
$model->where('id',$id)->setInc('number',$number);
$this->success('SUCCESS');
}
... ...