正在显示
1 个修改的文件
包含
1 行增加
和
1 行删除
@@ -70,7 +70,7 @@ class GoodsController extends RestBaseController | @@ -70,7 +70,7 @@ class GoodsController extends RestBaseController | ||
70 | if ($user_score<$param['price']){ | 70 | if ($user_score<$param['price']){ |
71 | $this->error(['code'=>40001,'msg'=>'用户积分不足']); | 71 | $this->error(['code'=>40001,'msg'=>'用户积分不足']); |
72 | } | 72 | } |
73 | - if (Db::name('goods_order')->where('id',$param['id'])->find()['stock']<$param['count']){ | 73 | + if (Db::name('goods')->where('id',$param['goods_id'])->find()['stock']<$param['count']){ |
74 | $this->error(['code'=>40002,'msg'=>'商品库存不足']); | 74 | $this->error(['code'=>40002,'msg'=>'商品库存不足']); |
75 | } | 75 | } |
76 | $re=Db::name('goods_order')->insert([ | 76 | $re=Db::name('goods_order')->insert([ |
-
请 注册 或 登录 后发表评论