wugg 2 years ago
parent
commit
3940d982e4
1 changed files with 2 additions and 2 deletions
  1. 2 2
      app/admin/model/OrderOutChild.php

+ 2 - 2
app/admin/model/OrderOutChild.php

@@ -27,9 +27,9 @@ class OrderOutChild extends Model
         if ($sale['wsend_num'] < $out['send_num']) throw new \Exception("订单待发货数量不足");
         $num = $out['send_num'];
         $wsmlist = self::name("good_stock")->alias("a")
-            ->leftJoin("warehouse_info b", "a.wsm_code=b.wsm_code and b.wsm_type in (2,5)")
+            ->leftJoin("warehouse_info b", "a.wsm_code=b.wsm_code")
             ->field("a.id,a.usable_stock,a.wait_out_stock,b.wsm_code,b.supplierNo,b.supplierName")
-            ->where(["spuCode" => $sale['good_code'], "a.is_del" => 0, "b.companyNo" => $sale['supplierNo']])
+            ->where(["spuCode" => $sale['good_code'], "a.is_del" => 0,"b.wsm_type"=>[2,5], "b.companyNo" => $sale['supplierNo']])
             ->where("a.usable_stock", ">=", $num)
             ->order("a.usable_stock asc")
             ->findOrEmpty();