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'])) {
|
||||
$dateSelect = DateTime::createFromFormat('Ymd', $options['date']);
|
||||
} else {
|
||||
$dateSelect->modify('first day of this month');
|
||||
$dateSelect->modify('first day of previous month');
|
||||
}
|
||||
|
||||
|
||||
@ -131,15 +131,11 @@ foreach(Db::getInstance()->ExecuteS('
|
||||
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
|
||||
WHERE
|
||||
(o.valid = 1
|
||||
OR (
|
||||
o.valid = 0
|
||||
AND ( os.id_order_state = 6 OR os.id_order_state = 7 OR os.id_order_state = 11)
|
||||
))
|
||||
( o.valid = 1 OR ( o.valid = 0 AND os.id_order_state IN (6, 7, 11, 15, 16) ) )
|
||||
AND o.date_add >= "'.$dateStartSql.'"
|
||||
AND o.date_add <= "'.$dateEndSql.'"
|
||||
GROUP BY o.id_order
|
||||
') as $row){
|
||||
') as $row) {
|
||||
$orders[(int)$row['id_order']] = array();
|
||||
$query_orders[(int)$row['id_order']] = (int)$row['id_order'];
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user