|
|
@@ -109,7 +109,7 @@ sql;
|
|
|
{
|
|
|
$db = DB::connection("oracle");
|
|
|
$sql = <<<sql
|
|
|
-select INV_LOT_LOC_ID.CUSTOMERID,INV_LOT_LOC_ID.SKU,INV_LOT_LOC_ID.LOCATIONID
|
|
|
+select INV_LOT_LOC_ID.CUSTOMERID,INV_LOT_LOC_ID.SKU,INV_LOT_LOC_ID.LOCATIONID,sum(INV_LOT_LOC_ID.QTY) qty
|
|
|
from INV_LOT_LOC_ID
|
|
|
left join BAS_LOCATION on BAS_LOCATION.LOCATIONID = INV_LOT_LOC_ID.LOCATIONID
|
|
|
where BAS_LOCATION.LOCATIONUSAGE = 'RS'
|
|
|
@@ -126,7 +126,7 @@ sql;
|
|
|
}
|
|
|
$sql .= ")";
|
|
|
}
|
|
|
- $sql.= ' group by INV_LOT_LOC_ID.CUSTOMERID,INV_LOT_LOC_ID.SKU,INV_LOT_LOC_ID.LOCATIONID';
|
|
|
+ $sql.= ' group by INV_LOT_LOC_ID.CUSTOMERID,INV_LOT_LOC_ID.SKU,INV_LOT_LOC_ID.LOCATIONID order by qty desc';
|
|
|
$info= $db->select(DB::raw($sql),[$customer]);
|
|
|
//整合同sku下的存储库位
|
|
|
$tmpArray = array();
|
|
|
@@ -134,7 +134,9 @@ sql;
|
|
|
$key = $row->sku;
|
|
|
if (array_key_exists($key, $tmpArray)) {
|
|
|
if (is_array($tmpArray[$key]['locationid'])) {
|
|
|
- $tmpArray[$key]['locationid'][] = $row->locationid;
|
|
|
+ if (count($tmpArray[$key]['locationid'])<5){
|
|
|
+ $tmpArray[$key]['locationid'][] = $row->locationid;
|
|
|
+ }
|
|
|
} else {
|
|
|
$tmpArray[$key]['locationid'] = array($tmpArray[$key]['locationid'], $row->locationid);
|
|
|
}
|