| @@ -8,8 +8,9 @@ | ||
| 8 | 8 | * Get the Total, Count, and Average of the payment totals for published donations of a given set of forms. |
| 9 | 9 | */ |
| 10 | 10 | class Query |
| 11 | 11 | { |
| 12 | + | |
| 12 | 13 | /** @var array */ |
| 13 | 14 | protected $formIDs; |
| 14 | 15 | |
| 15 | 16 | /** |
| @@ -27,9 +28,8 @@ | ||
| 27 | 28 | $this->formIDs = $formIDs; |
| 28 | 29 | } |
| 29 | 30 | |
| 30 | 31 | /** |
| 31 | - * @since 4.14.0 Replace {$wpdb->paymentmeta} with {$wpdb->donationmeta} | |
| 32 | 32 | * @since 3.14.0 Consider the donation mode (test or live) instead of querying both modes together |
| 33 | 33 | * @return string |
| 34 | 34 | */ |
| 35 | 35 | public function getSQL() |
| @@ -42,9 +42,9 @@ | ||
| 42 | 42 | count( payment.ID ) as count |
| 43 | 43 | FROM {$wpdb->posts} as payment |
| 44 | 44 | JOIN {$wpdb->give_revenue} as revenue |
| 45 | 45 | ON revenue.donation_id = payment.ID |
| 46 | - JOIN {$wpdb->donationmeta} paymentMode | |
| 46 | + JOIN {$wpdb->paymentmeta} paymentMode | |
| 47 | 47 | ON payment.ID = paymentMode.donation_id AND paymentMode.meta_key = '_give_payment_mode' |
| 48 | 48 | WHERE |
| 49 | 49 | payment.post_type = 'give_payment' |
| 50 | 50 | AND |
| @@ -52,9 +52,9 @@ | ||
| 52 | 52 | AND |
| 53 | 53 | paymentMode.meta_value = '{$mode}' |
| 54 | 54 | "; |
| 55 | 55 | |
| 56 | - if (!empty($this->formIDs)) { | |
| 56 | + if ( ! empty($this->formIDs)) { | |
| 57 | 57 | $sql .= ' |
| 58 | 58 | AND |
| 59 | 59 | revenue.form_id IN ( ' . $this->getFormsString() . ' ) |
| 60 | 60 | '; |