protected function defaultParamValues()
{
return array(
"startDatePicker"=>date("Y-m-d 00:00:00"),
"endDatePicker"=>date("Y-m-d 23:59:59"),
"customers"=>array(),
"fcusts"=>array(),
);
}
protected function bindParamsToInputs()
{
return array(
"startDatePicker",
"endDatePicker",
"customers",
"fcusts",
);
}
function setup()
{
$query_params = array();
if($this->params["startDatePicker"]!=array())
{
$query_params["start"] =$this->params["startDatePicker"];
}
if($this->params["endDatePicker"]!=array())
{
$query_params["end"] =$this->params["endDatePicker"];
}
if($this->params["customers"]!=array())
{
$query_params["customers"] =$this->params["customers"];
}
if($this->params["fcusts"]!=array())
{
$query_params["fcusts"] =$this->params["fcusts"];
}
$this->src('sales')
->query("~~~
WHERE A.write_date BETWEEN date_format(:start,'%Y-%m-%d') AND date_format(:end,'%Y-%m-%d')
".
(($this->params["customers"]!=array())?" AND C.creg_no IN (:customers)":"")
.
(($this->params["fcusts"]!=array())?" AND C.fcreg_no IN (:fcusts)":"")
)
->params($query_params)
Hello Great Team!! I'm not goot at English!! The code is the same as above. It will work normally, but if I enter a value in two items(customers, fcusts) as shown below, an error will occur. help me~ thx!!