sunhao 5 years ago
parent
commit
9d1b2c972c
1 changed files with 14 additions and 0 deletions
  1. 14 0
      app/Http/Controllers/Admin/OrderController.php

+ 14 - 0
app/Http/Controllers/Admin/OrderController.php

@@ -498,6 +498,13 @@ class OrderController extends Controller
498 498
                 $query->where('is_white', 1)->orWhere('quantity','>',0);
499 499
             })->first();
500 500
             if(empty($sku)) continue;
501
+            //计算实际库存 -还未到卖家云的量
502
+            $w_num = DB::table('order_goods_skus')->where('sku_id', $v['sku_id'])->where('is_del',0)->where('mj_status',0)->sum('num');
503
+            $quantity = $sku->quantity - $w_num;
504
+            if($quantity<=0){
505
+                continue;
506
+            }
507
+
501 508
             $data = array();
502 509
             $data['id'] = $v['id'];
503 510
             $data['goods_name'] = $goods_name;
@@ -888,6 +895,13 @@ class OrderController extends Controller
888 895
                 $query->where('is_white', 1)->orWhere('quantity','>',0);
889 896
             })->first();
890 897
             if(empty($sku)) continue;
898
+            //计算实际库存 -还未到卖家云的量
899
+            $w_num = DB::table('order_goods_skus')->where('sku_id', $val['sku_id'])->where('is_del',0)->where('mj_status',0)->sum('num');
900
+            $quantity = $sku->quantity - $w_num;
901
+            if($quantity<=0){
902
+                continue;
903
+            }
904
+
891 905
             $data = array();
892 906
             $data['id'] = $val['id'];
893 907
             $data['goods_name'] = $goods_name;