Skip to content

Instantly share code, notes, and snippets.

@SCIF
Created April 24, 2012 23:43
Show Gist options
  • Save SCIF/2484679 to your computer and use it in GitHub Desktop.
Save SCIF/2484679 to your computer and use it in GitHub Desktop.
$total_income = DB::query('SELECT'.
. DB::expr('SUM(total)') .
'FROM `' . DB::table_prefix() . 'bookings`'.
'WHERE `user_id` = ' . $this->template->user_id . ' ' .
'AND `status` != "prospect" ' .
'AND `status` != "cancelled" ' .
'AND `status` != "refunded" '
)->execute()->as_array();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment