Closed le51 closed 9 years ago
Workaround with :
$pilotes = $this->db->fetchAll("SELECT DISTINCT cdt_de_bord_id, cdt_de_bord FROM vols ORDER BY cdt_de_bord", Phalcon\Db::FETCH_NUM); //this give the correct response $this->view->setVar('pilotes',$pilotes);
and in view:
`
{% endfor %} `
but it seems that modelManager doesn't translate correctly the request and escape the DISTINCT keyword.
Can you please try again using Phalcon 2 or close this issue?
Vols::find(array("columns"=>array("cdt_de_bord_id","cdt_de_bord"), "order"=>"cdt_de_bord ASC","distinct"=>"cdt_de_bord_id"))
and
$query = $this->modelsManager->createQuery("SELECT DISTINCT cdt_de_bord_id, cdt_de_bord FROM Vols ORDER BY cdt_de_bord"); $cdb = $query->execute();
result this Postgresql log:
`exécute pdo_stmt_0000000a: SELECT "vols"."cdt_de_bord_id" AS "cdt_de_bord_id", "vols"."cdt_de_bord" AS "cdt_de_bord" FROM "public"."vols" ORDER BY "vols"."cdt_de_bord" ASC
is there something wrong ?
Postgresal & phalcon 1.3
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.