production: update sorting

This commit is contained in:
Michał Zieliński
2025-10-09 15:16:52 +02:00
parent c02009ad63
commit 07100c8f12
2 changed files with 84 additions and 43 deletions

View File

@@ -106,7 +106,7 @@ WHERE ps.deleted = 0 ";
if ($dateFrom != null && $dateTo != null) {
$query .= " AND (
(DATE(ps.production_date) >= '$dateFrom' AND DATE(ps.production_date) <= '$dateTo')
OR ps.production_date IS NULL OR DATE(ps.production_date) = '0000-00-00')";
OR ps.production_date IS NULL OR DATE(ps.production_date) = '0000-00-00 06:00:00')";
}
if ($ids != null) {
@@ -115,7 +115,6 @@ WHERE ps.deleted = 0 ";
$query .= "GROUP BY ps.id, s.id, si.id, p.id, ps_main.id, p_main.id ";
$rows = $db->query($query);
$data = array();
$i = 0;