mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-27 06:13:32 +09:00
17373170 * 쿼리 조건 값이 string, integer 일 경우만 조건을 설정하도록 변경
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@4629 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
84b4b3e50b
commit
357807a2f3
8 changed files with 60 additions and 37 deletions
|
|
@ -373,43 +373,52 @@
|
|||
function getConditionPart($name, $value, $operation) {
|
||||
switch($operation) {
|
||||
case 'equal' :
|
||||
case 'more' :
|
||||
case 'excess' :
|
||||
case 'less' :
|
||||
case 'below' :
|
||||
case 'like_tail' :
|
||||
case 'like_prefix' :
|
||||
case 'like' :
|
||||
case 'in' :
|
||||
case 'notequal' :
|
||||
// 변수가 세팅되지 않고, 문자열이나 숫자형이 아니면 리턴
|
||||
if(!isset($value)) return;
|
||||
if($value === '') return;
|
||||
if(!in_array(gettype($value), array('string', 'integer'))) return;
|
||||
}
|
||||
|
||||
switch($operation) {
|
||||
case 'equal' :
|
||||
return $name.' = '.$value;
|
||||
break;
|
||||
case 'more' :
|
||||
if(!isset($value)) return;
|
||||
return $name.' >= '.$value;
|
||||
break;
|
||||
case 'excess' :
|
||||
if(!isset($value)) return;
|
||||
return $name.' > '.$value;
|
||||
break;
|
||||
case 'less' :
|
||||
if(!isset($value)) return;
|
||||
return $name.' <= '.$value;
|
||||
break;
|
||||
case 'below' :
|
||||
if(!isset($value)) return;
|
||||
case 'below' :
|
||||
return $name.' < '.$value;
|
||||
break;
|
||||
case 'like_tail' :
|
||||
case 'like_prefix' :
|
||||
case 'like' :
|
||||
if(!isset($value)) return;
|
||||
case 'like_tail' :
|
||||
case 'like_prefix' :
|
||||
case 'like' :
|
||||
return $name.' like '.$value;
|
||||
break;
|
||||
case 'in' :
|
||||
if(!isset($value)) return;
|
||||
case 'in' :
|
||||
return $name.' in ('.$value.')';
|
||||
break;
|
||||
case 'notequal' :
|
||||
if(!isset($value)) return;
|
||||
case 'notequal' :
|
||||
return $name.' <> '.$value;
|
||||
break;
|
||||
case 'notnull' :
|
||||
case 'notnull' :
|
||||
return $name.' is not null';
|
||||
break;
|
||||
case 'null' :
|
||||
case 'null' :
|
||||
return $name.' is null';
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue