Skip to content

Instantly share code, notes, and snippets.

@drobinson
Last active November 30, 2022 20:16
Show Gist options
  • Save drobinson/caf6d9f65552f964373de28aa71abb1b to your computer and use it in GitHub Desktop.
Save drobinson/caf6d9f65552f964373de28aa71abb1b to your computer and use it in GitHub Desktop.
This code runs.
<?php
$this->getSelect()->group('main_table.giftvoucher_id')->joinLeft(
array('history' => $this->getTable('giftvoucher/history')),
'main_table.giftvoucher_id = history.giftvoucher_id', array(
'history_amount' => 'amount',
'history_currency' => 'currency',
'created_at',
'extra_content',
'order_increment_id'
)
)->where('history.amount > ?', 0 or 'history.action = ?', Company_Module_Model_Actions::ACTIONS_CREATE);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment