production: filter by date fix
This commit is contained in:
@@ -105,8 +105,8 @@ WHERE ps.deleted = 0 ";
|
|||||||
|
|
||||||
if ($dateFrom != null && $dateTo != null) {
|
if ($dateFrom != null && $dateTo != null) {
|
||||||
$query .= " AND (
|
$query .= " AND (
|
||||||
(ps.production_date >= '$dateFrom' AND ps.production_date <= '$dateTo')
|
(DATE(ps.production_date) >= '$dateFrom' AND DATE(ps.production_date) <= '$dateTo')
|
||||||
OR ps.production_date IS NULL OR ps.production_date = '0000-00-00')";
|
OR ps.production_date IS NULL OR DATE(ps.production_date) = '0000-00-00')";
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($ids != null) {
|
if ($ids != null) {
|
||||||
@@ -114,12 +114,14 @@ WHERE ps.deleted = 0 ";
|
|||||||
}
|
}
|
||||||
|
|
||||||
$query .= "GROUP BY ps.id, s.id, si.id, p.id, ps_main.id, p_main.id ";
|
$query .= "GROUP BY ps.id, s.id, si.id, p.id, ps_main.id, p_main.id ";
|
||||||
$query .= "ORDER BY s.delivery_date, s.register_date, s.document_no;";
|
|
||||||
|
echo $query;
|
||||||
|
|
||||||
$rows = $db->query($query);
|
$rows = $db->query($query);
|
||||||
$data = array();
|
$data = array();
|
||||||
$i = 0;
|
$i = 0;
|
||||||
while ($r = $db->fetchByAssoc($rows)) {
|
while ($r = $db->fetchByAssoc($rows)) {
|
||||||
|
var_dump( $r['production_date']);
|
||||||
$row = array();
|
$row = array();
|
||||||
$i++;
|
$i++;
|
||||||
$row['position'] = $i;
|
$row['position'] = $i;
|
||||||
|
|||||||
Reference in New Issue
Block a user