|
|
@@ -84,16 +84,16 @@ class UpdatePickZone implements ToCollection,WithHeadingRow
|
|
|
$max = null;
|
|
|
$map = [];
|
|
|
foreach ($lot as $i => $l){
|
|
|
- $qty = (int)$l->quty;
|
|
|
+ $qty = (int)$l->qty;
|
|
|
$map[$qty] = $i;
|
|
|
- if ($qty >= (int)$item["数量"] && $qty<=$max)$max = $qty;
|
|
|
- if ($qty < (int)$item["数量"] && $qty>=$min)$min = $qty;
|
|
|
+ if (($qty >= (int)$item["数量"] && $qty<=$max) || $max===null)$max = $qty;
|
|
|
+ if (($qty < (int)$item["数量"] && $qty>=$min) || $min===null)$min = $qty;
|
|
|
}
|
|
|
if ($max !== null)$result = $lot[$map[$max]];
|
|
|
else $result = $lot[$map[$min]];
|
|
|
}
|
|
|
if (count($lot) == 1)$result = $lot[0];
|
|
|
- if ($result){dd($result);
|
|
|
+ if ($result){
|
|
|
try{
|
|
|
$detail->update([
|
|
|
"lotnum" => $result->lotnum,
|