Commit e5d98daf authored by hangjun83's avatar hangjun83

更新

parent 267d5f27
......@@ -209,19 +209,21 @@ class WuxiLabService
return false;
}
try{
$rawIdList = $newPackages = [];
$rawsList = $newPackages = [];
if(count($params['products']) > 5000){
$slice_array_length = $current_length = 500;
$slice_array_length= 500;
$current_length = 0;
while(true){
$product = array_slice($params['products'],$current_length);
$rawsList = $this->rhawnChemicalsService->getChemicalRawThroughtCode($product);
if($rawsList){
$tempList = [];
$list = [];
$product = array_slice($params['products'],$current_length,$slice_array_length);
$list = $this->rhawnChemicalsService->getChemicalRawThroughtCode($product);
if($list){
$rawIdList = [];
foreach ($rawsList as $raw){
$tempList[] = $raw['r_id'];
$rawIdList[] = $raw['r_id'];
}
$packages = $this->rhawnChemicalsService->getChemicalPackage($tempList);
$rawsList = array_merge($rawsList,$list);
$packages = $this->rhawnChemicalsService->getChemicalPackage($rawIdList);
if($packages){
foreach($packages as $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