update

FFIB 5 年之前
父節點
當前提交
6e106f43bd
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. 4 0
      live/views.py

+ 4 - 0
live/views.py

@@ -137,6 +137,10 @@ def live_order_create(request):
137 137
     except:
138 138
         return response(400001, 'Room Goods Not Found', description='直播间商品不存在')
139 139
 
140
+    #库存校验
141
+    if room_goods_info.inventory <= 0:
142
+        return response(400001, 'Room Goods Not En', description='商品库存不足')
143
+
140 144
     # 金额校验
141 145
     try:
142 146
         goods_info = liveGoodsInfo.objects.get(goods_id=goods_id)