phalcon builder 用法

$rawSql = $builder->columns(["aa","bb"])

->from("TableName")
->where("Item1 = 4 AND Item2 = 1")
->getPhql();
$items = $builder->getQuery()->execute();

注意colums和where的不同。

 

$result = $this->modelsManager->createBuilder()
->columns('aa')
->from('BB')
->where("date='$cc->date' AND ID =" .DD::ID)
->getQuery()
->getSingleResult();

echo $result->aa;

 

 

$results = $this->modelsManager->createBuilder()
->columns('aa')
->from('BB')
->where("date='$cc->date' AND ID =" .DD::ID)
->getQuery()
->execute()
->toArray();

 

posted @ 2016-05-23 21:16  圆旭  阅读(645)  评论(0编辑  收藏  举报