17373170 * 쿼리 조건 값이 string, integer 일 경우만 조건을 설정하도록 변경

git-svn-id: http://xe-core.googlecode.com/svn/sandbox@4629 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
bnu 2008-10-16 13:59:15 +00:00
parent 84b4b3e50b
commit 357807a2f3
8 changed files with 60 additions and 37 deletions

View file

@ -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;
}

View file

@ -377,11 +377,13 @@
function getCondition($output) {
if(!$output->conditions) return;
$condition = "";
foreach($output->conditions as $key => $val) {
$condition = '';
foreach($output->conditions as $val) {
$sub_condition = '';
foreach($val['condition'] as $k =>$v) {
if(!isset($v['value']) || $v['value'] === '') continue;
foreach($val['condition'] as $v) {
if(!isset($v['value'])) continue;
if($v['value'] === '') continue;
if(!in_array(gettype($v['value']), array('string', 'integer'))) continue;
$name = $v['column'];
$operation = $v['operation'];

View file

@ -589,10 +589,12 @@
function getCondition($output) {
if(!$output->conditions) return;
foreach($output->conditions as $key => $val) {
foreach($output->conditions as $val) {
$sub_condition = '';
foreach($val['condition'] as $k =>$v) {
if(!isset($v['value']) || $v['value'] === '') continue;
foreach($val['condition'] as $v) {
if(!isset($v['value'])) continue;
if($v['value'] === '') continue;
if(!in_array(gettype($v['value']), array('string', 'integer'))) continue;
$name = $v['column'];
$operation = $v['operation'];

View file

@ -366,10 +366,12 @@
function getCondition($output) {
if(!$output->conditions) return;
foreach($output->conditions as $key => $val) {
foreach($output->conditions as $val) {
$sub_condition = '';
foreach($val['condition'] as $k =>$v) {
if(!isset($v['value']) || $v['value'] === '') continue;
foreach($val['condition'] as $v) {
if(!isset($v['value'])) continue;
if($v['value'] === '') continue;
if(!in_array(gettype($v['value']), array('string', 'integer'))) continue;
$name = $v['column'];
$operation = $v['operation'];

View file

@ -376,10 +376,12 @@
function getCondition($output) {
if(!$output->conditions) return;
foreach($output->conditions as $key => $val) {
foreach($output->conditions as $val) {
$sub_condition = '';
foreach($val['condition'] as $k =>$v) {
if(!isset($v['value']) || $v['value'] === '') continue;
foreach($val['condition'] as $v) {
if(!isset($v['value'])) continue;
if($v['value'] === '') continue;
if(!in_array(gettype($v['value']), array('string', 'integer'))) continue;
$name = $v['column'];
$operation = $v['operation'];

View file

@ -368,10 +368,12 @@
function getCondition($output) {
if(!$output->conditions) return;
foreach($output->conditions as $key => $val) {
foreach($output->conditions as $val) {
$sub_condition = '';
foreach($val['condition'] as $k =>$v) {
if(!isset($v['value']) || $v['value'] === '') continue;
foreach($val['condition'] as $v) {
if(!isset($v['value'])) continue;
if($v['value'] === '') continue;
if(!in_array(gettype($v['value']), array('string', 'integer'))) continue;
$name = $v['column'];
$operation = $v['operation'];

View file

@ -349,10 +349,12 @@
function getCondition($output) {
if(!$output->conditions) return;
foreach($output->conditions as $key => $val) {
foreach($output->conditions as $val) {
$sub_condition = '';
foreach($val['condition'] as $k =>$v) {
if(!isset($v['value']) || $v['value'] === '') continue;
foreach($val['condition'] as $v) {
if(!isset($v['value'])) continue;
if($v['value'] === '') continue;
if(!in_array(gettype($v['value']), array('string', 'integer'))) continue;
$name = $v['column'];
$operation = $v['operation'];

View file

@ -378,10 +378,12 @@
function getCondition($output) {
if(!$output->conditions) return;
foreach($output->conditions as $key => $val) {
foreach($output->conditions as $val) {
$sub_condition = '';
foreach($val['condition'] as $k =>$v) {
if(!isset($v['value']) || $v['value'] === '') continue;
foreach($val['condition'] as $v) {
if(!isset($v['value'])) continue;
if($v['value'] === '') continue;
if(!in_array(gettype($v['value']), array('string', 'integer'))) continue;
$name = $v['column'];
$operation = $v['operation'];