Missing DISTINCT keyword
This commit is contained in:
parent
0ce99fbdbb
commit
df057abe88
|
@ -124,7 +124,7 @@ class WC_Widget_Rating_Filter extends WC_Widget {
|
|||
$meta_query_sql = $meta_query->get_sql( 'post', $wpdb->posts, 'ID' );
|
||||
$tax_query_sql = $tax_query->get_sql( $wpdb->posts, 'ID' );
|
||||
|
||||
$sql = "SELECT COUNT( {$wpdb->posts}.ID ) FROM {$wpdb->posts} ";
|
||||
$sql = "SELECT COUNT( DISTINCT {$wpdb->posts}.ID ) FROM {$wpdb->posts} ";
|
||||
$sql .= $tax_query_sql['join'] . $meta_query_sql['join'];
|
||||
$sql .= " WHERE {$wpdb->posts}.post_type = 'product' AND {$wpdb->posts}.post_status = 'publish' ";
|
||||
$sql .= $tax_query_sql['where'] . $meta_query_sql['where'];
|
||||
|
|
Loading…
Reference in New Issue