New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix order export date interval #2129

Merged
merged 1 commit into from Apr 28, 2016
Jump to file or symbol
Failed to load files and symbols.
+17 −13
Diff settings

Always

Just for now

@@ -30,7 +30,6 @@
/**
* Class OrderExport
* @author Benjamin Perche <bperche@openstudio.fr>
* @author Jérôme Billiras <jbilliras@openstudio.fr>
*/
class OrderExport extends AbstractExport
@@ -87,7 +86,20 @@ class OrderExport extends AbstractExport
public function current()
{
$order = parent::current();
do {
$order = parent::current();
$getNext = false;
if ($this->rangeDate !== null
&& (
$order[OrderTableMap::CREATED_AT] < $this->rangeDate['start']
|| $order[OrderTableMap::CREATED_AT] > $this->rangeDate['end']
)
) {
$this->next();
$getNext = true;
}
} while ($getNext && $this->valid());
$locale = $this->language->getLocale();
@@ -274,17 +286,9 @@ public function current()
$locale
);
// if ($this->rangeDate !== null) {
// $start_date = \DateTime::createFromFormat('Y-n-d', $this->rangeDate['start']['year'].'-'.$this->rangeDate['start']['month'].'-'.$this->rangeDate['start']['day']);
// $end_date = \DateTime::createFromFormat('Y-n-d', $this->rangeDate['end']['year'].'-'.$this->rangeDate['end']['month'].'-'.$this->rangeDate['start']['day']);
//
// $query
// ->filterByCreatedAt(sprintf('%s 00:00:00', $start_date->format('Y-m-d')), Criteria::GREATER_EQUAL)
// ->filterByCreatedAt(sprintf('%s 23:59:59', $end_date->format('Y-m-d')), Criteria::LESS_EQUAL);
// }
$data = $query->findPk($order[OrderTableMap::ID]);
$data = $query
->filterById($order[OrderTableMap::ID])
->findOne();
$order = (new Order)
->setId($order[OrderTableMap::ID])
ProTip! Use n and p to navigate between commits in a pull request.