如何执行和获取从\ Phalcon \ Mvc \ Model \ Query \ Builder创建的查询

时间:2015-07-01 14:03:39

标签: phalcon

嘿我想获取此查询,但无法从google或stackoverflow找到结果

我的代码就像:

         $params = array(
        'models'     => array('hits'),
        'columns'    => array('icerik', 'COUNT(*)'),
        'conditions' => array(
            array(
                "durum = 1"
            ),
        ),
        // or 'conditions' => "created > '2013-01-01' AND created < '2014-01-01'",
        'group'      => array('icerik'),
        'order'      => array('COUNT(*)'),
        'limit'      => 20,
        // or 'limit' => array(20, 20),
    );
    $queryBuilder = new \Phalcon\Mvc\Model\Query\Builder($params);

谢谢,

1 个答案:

答案 0 :(得分:1)

你会按照

的方式做点什么
$results = $queryBuilder->getQuery()->execute();

获取结果集。