...
|
...
|
@@ -70,7 +70,7 @@ class GoodsController extends RestBaseController |
|
|
if ($user_score<$param['price']){
|
|
|
$this->error(['code'=>40001,'msg'=>'用户积分不足']);
|
|
|
}
|
|
|
if (Db::name('goods_order')->where('id',$param['id'])->find()['stock']<$param['count']){
|
|
|
if (Db::name('goods')->where('id',$param['goods_id'])->find()['stock']<$param['count']){
|
|
|
$this->error(['code'=>40002,'msg'=>'商品库存不足']);
|
|
|
}
|
|
|
$re=Db::name('goods_order')->insert([
|
...
|
...
|
|