Added support for add arrays to where sql statements
This commit is contained in:
parent
0bfcff6b42
commit
3a3addf7b0
1 changed files with 36 additions and 1 deletions
|
|
@ -776,8 +776,43 @@ class Webmodel {
|
|||
$quot='';
|
||||
|
||||
}
|
||||
else
|
||||
if(gettype($arg)==='array')
|
||||
{
|
||||
|
||||
$arr_conditions[$key]=trim($arr_conditions[$key].$quot.$this->escape_string($arg).$quot);
|
||||
array_walk($arg, function(&$item, $key) {
|
||||
|
||||
$quot_array='"';
|
||||
|
||||
if(gettype($item)==='integer' || gettype($item)==='float')
|
||||
{
|
||||
|
||||
$quot_array='';
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
$item=$this->escape_string($item);
|
||||
|
||||
}
|
||||
|
||||
$item=$quot_array.$item.$quot_array;
|
||||
|
||||
});
|
||||
|
||||
$arg='('.implode(', ', $arg).')';
|
||||
|
||||
$quot='';
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
$arg=$this->escape_string($arg);
|
||||
|
||||
}
|
||||
|
||||
$arr_conditions[$key]=trim($arr_conditions[$key].$quot.$arg.$quot);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue