You are here

function pay_handler_filter_amount::query in Pay 7

Same name and namespace in other branches
  1. 6 includes/views/pay_handler_filter_amount.inc \pay_handler_filter_amount::query()

Add this filter to the query.

Due to the nature of fapi, the value and the operator have an unintended level of indirection. You will find them in $this->operator and $this->value respectively.

Overrides views_handler_filter_numeric::query

File

includes/views/pay_handler_filter_amount.inc, line 127

Class

pay_handler_filter_amount
Simple filter to handle greater than/less than filters

Code

function query() {
  $this
    ->ensure_my_table();
  $field = "{$this->table_alias}.{$this->real_field}";
  $sql = "SELECT SUM({$this->real_field}) FROM {pay_transaction} px WHERE px.pfid = {$this->table_alias}.pfid";
  $field_alias = $this->query
    ->add_field('', "({$sql})", $this->real_field . '_total_paid');
  $this->field_alias = $field = $field_alias;
  $info = $this
    ->operators();
  if (!empty($info[$this->operator]['method'])) {
    $this
      ->{$info[$this->operator]['method']}($field);
  }
}