| @@ 306-320 (lines=15) @@ | ||
| 303 | * @global wpdb $wpdb |
|
| 304 | * @return string |
|
| 305 | */ |
|
| 306 | private function get_where_donor() { |
|
| 307 | $where = ''; |
|
| 308 | ||
| 309 | // Specific donors. |
|
| 310 | if ( ! empty( $this->args['donor'] ) ) { |
|
| 311 | if ( ! is_array( $this->args['donor'] ) ) { |
|
| 312 | $this->args['donor'] = explode( ',', $this->args['donor'] ); |
|
| 313 | } |
|
| 314 | $donor_ids = implode( ',', array_map( 'intval', $this->args['donor'] ) ); |
|
| 315 | ||
| 316 | $where .= "AND {$this->table_name}.id IN( {$donor_ids} )"; |
|
| 317 | } |
|
| 318 | ||
| 319 | return $where; |
|
| 320 | } |
|
| 321 | ||
| 322 | /** |
|
| 323 | * Set date where clause. |
|
| @@ 400-414 (lines=15) @@ | ||
| 397 | * @global wpdb $wpdb |
|
| 398 | * @return string |
|
| 399 | */ |
|
| 400 | private function get_where_user() { |
|
| 401 | $where = ''; |
|
| 402 | ||
| 403 | // Donors create for specific wp user. |
|
| 404 | if ( ! empty( $this->args['user'] ) ) { |
|
| 405 | if ( ! is_array( $this->args['user'] ) ) { |
|
| 406 | $this->args['user'] = explode( ',', $this->args['user'] ); |
|
| 407 | } |
|
| 408 | $user_ids = implode( ',', array_map( 'intval', $this->args['user'] ) ); |
|
| 409 | ||
| 410 | $where .= "AND {$this->table_name}.user_id IN( {$user_ids} )"; |
|
| 411 | } |
|
| 412 | ||
| 413 | return $where; |
|
| 414 | } |
|
| 415 | ||
| 416 | /** |
|
| 417 | * Set orderby query |
|