Phalcon框架数据查询问题
< 返回列表时间: 2017-03-28来源:开源中国
HDC调试需求开发(15万预算),能者速来!>>>
我的代码如下: $builder = $this->getModelsManager()->createBuilder()->from(self::getClassName()); if (!empty($name)) $builder->where("order_id like 🆔 or order_name like 🆔", array('id' => "%$name%"), array(Column::BIND_PARAM_STR, Column::BIND_PARAM_STR)); if (!empty($code)) $builder->andWhere("order_sn like :order:", array('order' => "%$code%"), array(Column::BIND_PARAM_STR, Column::BIND_PARAM_STR));
我要在后面加上查询当天记录的条件,因为我不会Phalcon,不知道代码该怎么写。或者使用原生SQL查询,怎么返回$builder。因为我要在Controller这样处理它: $builder = $exceptionModel->getQueryListBuilder($name, $code, $str); $paginator = new QueryBuilder(array( "builder" => $builder, "limit" => $pageSize, "page" => $pageIndex )); $param = array( 'limit' => $pageSize ); $this->view->setVars(array( 'title' => '活跃客户', 'name' => $name, 'order' => $code, 'param' => $param, 'param_uri' => http_build_query($param), 'page' => $paginator->getPaginate() ));
热门排行