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