Commit e5d98daf authored by hangjun83's avatar hangjun83

更新

parent 267d5f27
...@@ -209,19 +209,21 @@ class WuxiLabService ...@@ -209,19 +209,21 @@ class WuxiLabService
return false; return false;
} }
try{ try{
$rawIdList = $newPackages = []; $rawsList = $newPackages = [];
if(count($params['products']) > 5000){ if(count($params['products']) > 5000){
$slice_array_length = $current_length = 500; $slice_array_length= 500;
$current_length = 0;
while(true){ while(true){
$product = array_slice($params['products'],$current_length); $list = [];
$rawsList = $this->rhawnChemicalsService->getChemicalRawThroughtCode($product); $product = array_slice($params['products'],$current_length,$slice_array_length);
if($rawsList){ $list = $this->rhawnChemicalsService->getChemicalRawThroughtCode($product);
$tempList = []; if($list){
$rawIdList = [];
foreach ($rawsList as $raw){ foreach ($rawsList as $raw){
$tempList[] = $raw['r_id'];
$rawIdList[] = $raw['r_id']; $rawIdList[] = $raw['r_id'];
} }
$packages = $this->rhawnChemicalsService->getChemicalPackage($tempList); $rawsList = array_merge($rawsList,$list);
$packages = $this->rhawnChemicalsService->getChemicalPackage($rawIdList);
if($packages){ if($packages){
foreach($packages as $pack){ foreach($packages as $pack){
$newPackages[$pack['r_code']] = $pack; $newPackages[$pack['r_code']] = $pack;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment