Commit 267d5f27 authored by hangjun83's avatar hangjun83

更新

parent 4d36ccec
......@@ -209,18 +209,31 @@ class WuxiLabService
return false;
}
try{
$rawsList = $this->rhawnChemicalsService->getChemicalRawThroughtCode($params['products']);
if($rawsList){
foreach ($rawsList as $raw){
$rawIdList[] = $raw['r_id'];
}
$packages = $this->rhawnChemicalsService->getChemicalPackage($rawIdList);
$newPackages = [];
if($packages){
foreach($packages as $pack){
$newPackages[$pack['r_code']] = $pack;
$rawIdList = $newPackages = [];
if(count($params['products']) > 5000){
$slice_array_length = $current_length = 500;
while(true){
$product = array_slice($params['products'],$current_length);
$rawsList = $this->rhawnChemicalsService->getChemicalRawThroughtCode($product);
if($rawsList){
$tempList = [];
foreach ($rawsList as $raw){
$tempList[] = $raw['r_id'];
$rawIdList[] = $raw['r_id'];
}
$packages = $this->rhawnChemicalsService->getChemicalPackage($tempList);
if($packages){
foreach($packages as $pack){
$newPackages[$pack['r_code']] = $pack;
}
}
}
if($current_length >= $slice_array_length){
break;
}
$current_length += $slice_array_length;
}
ini_set('memory_limit','3072M');
$path = app(WuxiLabExport::class)->saveExcel(
['rawList' => $rawsList,'packageList' => $newPackages],
......
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