Get the first day of previous month
This commit is contained in:
parent
a248d66cde
commit
06bf95e914
@ -33,7 +33,7 @@ $dateSelect = new DateTime();
|
|||||||
if (isset($options['date'])) {
|
if (isset($options['date'])) {
|
||||||
$dateSelect = DateTime::createFromFormat('Ymd', $options['date']);
|
$dateSelect = DateTime::createFromFormat('Ymd', $options['date']);
|
||||||
} else {
|
} else {
|
||||||
$dateSelect->modify('first day of this month');
|
$dateSelect->modify('first day of previous month');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -131,11 +131,7 @@ foreach(Db::getInstance()->ExecuteS('
|
|||||||
LEFT JOIN `'._DB_PREFIX_.'customer` c ON c.id_customer = o.id_customer
|
LEFT JOIN `'._DB_PREFIX_.'customer` c ON c.id_customer = o.id_customer
|
||||||
LEFT JOIN `'._DB_PREFIX_.'order_state_current` os ON os.id_order = o.id_order
|
LEFT JOIN `'._DB_PREFIX_.'order_state_current` os ON os.id_order = o.id_order
|
||||||
WHERE
|
WHERE
|
||||||
(o.valid = 1
|
( o.valid = 1 OR ( o.valid = 0 AND os.id_order_state IN (6, 7, 11, 15, 16) ) )
|
||||||
OR (
|
|
||||||
o.valid = 0
|
|
||||||
AND ( os.id_order_state = 6 OR os.id_order_state = 7 OR os.id_order_state = 11)
|
|
||||||
))
|
|
||||||
AND o.date_add >= "'.$dateStartSql.'"
|
AND o.date_add >= "'.$dateStartSql.'"
|
||||||
AND o.date_add <= "'.$dateEndSql.'"
|
AND o.date_add <= "'.$dateEndSql.'"
|
||||||
GROUP BY o.id_order
|
GROUP BY o.id_order
|
||||||
|
Loading…
Reference in New Issue
Block a user