używanie wirtualnych pól do sumowania wartości w cakephp

Próbuję uzyskać sumę głosów dla danego użytkownika.

Powiedz, że to jest tabela postów

id | body  | user_id | vote_total | type
1    test     1          4          new
2    test2    1          3          new
3    test3    2          2          new

Próbuję uzyskać następujące dane wyjściowe

user_id  | vote_total
 1          7
 2          2

Oto moja funkcja w PostsController

 public function topvotes(){ 
    $virtualFields = array('total' => 'SUM(Post.vote_total)');
    $total = $this->Post->find('all', array(
                            array('fields' => array('total'), 
                            'recursive' => 1,
                            'group' => array('Post.user_id'),
                            'conditions'=>array('Post.type' => 'new' ))));

    $post = $this->Post->find('all', $total);
    $this->set('posts', $post);
}

To zapytanie działa (próbowałem za pomocą phpmyadmin), ale nie wiem, jak uzyskać dostęp do wynikowej tablicy

edytuj Mam go do pracy przy użyciu następującej kwerendy

$query = $this->Post->query("select posts.user_id, SUM(Posts.vote_total) from posts where posts.type = 'new' group by posts.user_id");
    $this->set('posts', $query);

kiedy wpisuję print_r, jest to tablica

Array ( [posts] => Array ( [user_id] => 7 ) [0] => Array ( [total] => 6 ) ) 1

questionAnswers(2)

yourAnswerToTheQuestion