fixes in conditions
This commit is contained in:
parent
c30a4a5da1
commit
c4a7f65833
2 changed files with 13 additions and 7 deletions
|
|
@ -27,7 +27,7 @@ function select_a_row_method_class($class, $idrow, $arr_select=array(), $raw_que
|
||||||
|
|
||||||
settype($idrow, 'integer');
|
settype($idrow, 'integer');
|
||||||
|
|
||||||
$class->set_conditions('where '.$class->name.'.`'.$class->idmodel.'`=\''.$idrow.'\'');
|
$class->set_conditions(['where '.$class->name.'.`'.$class->idmodel.'`=?', [$idrow]]);
|
||||||
|
|
||||||
$class->set_limit('limit 1');
|
$class->set_limit('limit 1');
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -713,10 +713,10 @@ class Webmodel {
|
||||||
$args=$this->args;
|
$args=$this->args;
|
||||||
|
|
||||||
$raw_query=0;
|
$raw_query=0;
|
||||||
|
|
||||||
if(gettype($conditions)=='array')
|
if(gettype($conditions)=='array')
|
||||||
{
|
{
|
||||||
|
|
||||||
$str_conditions=$conditions[0];
|
$str_conditions=$conditions[0];
|
||||||
|
|
||||||
$args=$conditions[1];
|
$args=$conditions[1];
|
||||||
|
|
@ -738,9 +738,9 @@ class Webmodel {
|
||||||
$args=[];
|
$args=[];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$str_conditions=trim($str_conditions);
|
$str_conditions=trim($str_conditions);
|
||||||
|
|
||||||
if($str_conditions=='')
|
if($str_conditions=='')
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
@ -749,12 +749,12 @@ class Webmodel {
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
||||||
//Check execution
|
//Check execution
|
||||||
|
|
||||||
if($raw_query==0)
|
if($raw_query==0)
|
||||||
{
|
{
|
||||||
|
|
||||||
if(preg_match('/".*"/', $str_conditions) || preg_match('/\'.*\'/', $str_conditions))
|
if(preg_match('/".*"/', $str_conditions) || preg_match('/\'.*\'/', $str_conditions))
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
@ -785,6 +785,12 @@ class Webmodel {
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
|
||||||
|
$this->conditions=trim($str_conditions);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue