Files
wms-app/app/ics/api/engine/retrieve_rack.php
T

38 lines
915 B
PHP

<?php
session_start();
require '../../../assets/utils/db_auth.php';
$id = (int)$data['id'];
$warehouse = (int)$data['warehouse'];
$sql = "SELECT *
FROM md_storage
WHERE
company_id = :company_id and
warehouse = :warehouse and
`zone` = :zone and
:aisle between aisle_from and aisle_to
";
$sth = $pdo2->prepare($sql);
$sth->execute([
":company_id" => $company_id,
":warehouse" => $warehouse,
":zone" => $data["zone"],
":aisle" => $data["aisle"]
]);
db_check($sth, $answer);
$pre = $sth->fetchAll(PDO::FETCH_ASSOC);
$output = [];
foreach ($pre as $key => $value) {
$output = array_merge($output, range($value["rack_form"], $value["rack_to"]));
}
$answer["output"] = $output;
$answer["success"] = 1;
exit(json_encode($answer));
?>