Pārlūkot izejas kodu

修改OrderCommodityService

ajun 5 gadi atpakaļ
vecāks
revīzija
4d9fccc973
1 mainītis faili ar 1 papildinājumiem un 3 dzēšanām
  1. 1 3
      app/Services/OrderCommodityService.php

+ 1 - 3
app/Services/OrderCommodityService.php

@@ -37,16 +37,14 @@ Class OrderCommodityService
         $dataHandlerService = app('DataHandlerService');
         $orderNos = data_get($orderHeaders,'*.orderno');
         $owner_codes = [];$sku_codes = [];
-        $count = 0;
         foreach ($orderHeaders as $orderHeader) {
             $actAllocationDetails  = $orderHeader->actAllocationDetails;
             foreach ($actAllocationDetails as $actAllocationDetail) {
                 $owner_codes[$actAllocationDetail['customerid']] = $actAllocationDetail['customerid'];
                 $sku_codes[$actAllocationDetail['sku']] = $actAllocationDetail['sku'];
-                $count++;
             }
         }
-
+        if(count($sku_codes) ==0)return;
         $owners = $ownerService->getOwnerByCodes($owner_codes);
         $owner_id_maps = $dataHandlerService->dataHeader(['id'],$owners);
         $commodities = $commodityService->get_(data_get($owners,'*.id'),$sku_codes,[],true);