WordPress primitive query returns = array

i am trying to primitive query form this wp_query:

$  query_v = array(     'post_type' => array('pro'),     'posts_per_page'    => -1,     'orderby' => $  count_visit,     'order' => 'ASC',     'tax_query' => array(         array(             'taxonomy' => 'servizi_pro',             'field' => 'slug',             'terms' => $  art_p,             'parent' => 0         )     ) ); 

the problem with this wp_query is that it does not sort me by the number of post views counter that I downloaded as an additional plugin, and I am trying to implement in a primita wordpress query, the wp_query with the addition of the instructions to display the type of custom posts based on the number of views:

<?php global $  wpdb; $  cpt = "pro";  $  q = $  wpdb->get_results(     $  wpdb->prepare(" SELECT * FROM {$  wpdb->prefix}term_relationships  LEFT JOIN {$  wpdb->prefix}terms ON {$  wpdb->prefix}term_relationships.term_taxonomy_id = {$  wpdb->prefix}terms.term_id  LEFT JOIN term_taxonomy ON {$  wpdb->prefix}term_relationships.term_taxonomy_id = {$  wpdb->prefix}term_taxonomy.term_id  LEFT JOIN {$  wpdb->prefix}posts  ON {$  wpdb->prefix}term_relationships.object_id = {$  wpdb->prefix}posts.ID  LEFT JOIN post_views ON {$  wpdb->prefix}term_relationships.object_id = {$  wpdb->prefix}post_views.id  WHERE  {$  wpdb->prefix}post_views.type = '4'    AND {$  wpdb->prefix}posts.post_type = '$  cpt'  AND  {$  wpdb->prefix}terms.name = '$  art_p'         ") ); ?>  <?php print_r($  q);?> <?php foreach ($  q as $  r){ ?>     <?php echo "{$  r->post_title}"; ?> <?php } ?> 

but it always returns to me array (), where am I wrong?