<?php
$this->view->title = 'Search Customer ::';
$numberPage = 1;
if ($this->request->isPost())
{
$query = Criteria::fromInput($this->di, "Customer", $_POST);
$this->persistent->parameters = $query->getParams();
}
else
{
$numberPage = $this->request->getQuery("page", "int");
}
$parameters = $this->persistent->parameters;
$parameters["order"] = "cus_id";
if (!is_array($parameters))
{
$parameters = array();
}
var_dump($query->getParams());
$customer = Customer::find($parameters);
This is a slightly modified scaffold code to search. I want to add one more condition to the query. The above code will return result for the query
-
select from customer where name like '%foo%' I wanto to change the query into something like
- select from customer where name like '%foo%' and user_name = 'user_name'
user_name can be get from session data