| @@ 330-344 (lines=15) @@ | ||
| 327 | * @global wpdb $wpdb |
|
| 328 | * @return string |
|
| 329 | */ |
|
| 330 | private function get_where_donor() { |
|
| 331 | $where = ''; |
|
| 332 | ||
| 333 | // Specific donors. |
|
| 334 | if ( ! empty( $this->args['donor'] ) ) { |
|
| 335 | if ( ! is_array( $this->args['donor'] ) ) { |
|
| 336 | $this->args['donor'] = explode( ',', $this->args['donor'] ); |
|
| 337 | } |
|
| 338 | $donor_ids = implode( ',', array_map( 'intval', $this->args['donor'] ) ); |
|
| 339 | ||
| 340 | $where .= "AND {$this->table_name}.id IN( {$donor_ids} )"; |
|
| 341 | } |
|
| 342 | ||
| 343 | return $where; |
|
| 344 | } |
|
| 345 | ||
| 346 | /** |
|
| 347 | * Set date where clause. |
|
| @@ 428-442 (lines=15) @@ | ||
| 425 | * @global wpdb $wpdb |
|
| 426 | * @return string |
|
| 427 | */ |
|
| 428 | private function get_where_user() { |
|
| 429 | $where = ''; |
|
| 430 | ||
| 431 | // Donors create for specific wp user. |
|
| 432 | if ( ! empty( $this->args['user'] ) ) { |
|
| 433 | if ( ! is_array( $this->args['user'] ) ) { |
|
| 434 | $this->args['user'] = explode( ',', $this->args['user'] ); |
|
| 435 | } |
|
| 436 | $user_ids = implode( ',', array_map( 'intval', $this->args['user'] ) ); |
|
| 437 | ||
| 438 | $where .= "AND {$this->table_name}.user_id IN( {$user_ids} )"; |
|
| 439 | } |
|
| 440 | ||
| 441 | return $where; |
|
| 442 | } |
|
| 443 | ||
| 444 | /** |
|
| 445 | * Set orderby query |
|