/** * Refresh sales order report statistics for last day * * @return void */ public function execute() { $this->localeResolver->emulate(0); $currentDate = $this->localeDate->date(); $date = $currentDate->sub(new \DateInterval('PT25H')); $this->orderFactory->create()->aggregate($date); $this->localeResolver->revert(); }
/** * Retrieve query for attribute with timezone conversion * * @param string $range * @param string $attribute * @param string|null $from * @param string|null $to * @return string */ protected function _getTZRangeOffsetExpression($range, $attribute, $from = null, $to = null) { return str_replace('{{attribute}}', $this->_reportOrderFactory->create()->getStoreTZOffsetQuery($this->getMainTable(), $attribute, $from, $to), $this->_getRangeExpression($range)); }