/**
* Gets the turnover and visitors amount for the
* chart and the grid in the "Turnover - Yesterday and today"-widget.
*
* @return void
*/
public function getTurnOverVisitorsAction() { $startDate =
new DateTime();
$startDate->
setTime(0, 0, 0
)->
sub(new DateInterval('P7D'
));
// Get turnovers
/** @var array $fetchAmount */
$fetchAmount =
$this->
get('db'
)->
fetchRow( 'SELECT
(
SELECT sum(invoice_amount/currencyFactor) AS amount
FROM s_order
WHERE TO_DAYS(ordertime) = TO_DAYS(now())
AND status != 4
AND status != -1
) AS today,
(
SELECT sum(invoice_amount/currencyFactor) AS amount
FROM s_order
WHERE TO_DAYS(ordertime) = (TO_DAYS( NOW( ) )-1)
AND status != 4
AND status != -1
) AS yesterday
'