Ignore:
Timestamp:
2012/06/19 18:01:38 (12 years ago)
Author:
pineray
Message:

#1669 #1859 初期化漏れ、無駄な変数等

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/version-2_12-dev/data/class/SC_SelectSql.php

    r21867 r21926  
    122122    // checkboxなどで同一カラム内で単一、もしくは複数選択肢が有る場合 例: AND ( sex = xxx OR sex = xxx OR sex = xxx) AND ... 
    123123    function setItemTerm($arr, $ItemStr) { 
    124  
     124        $return = array(); 
    125125        foreach ($arr as $data) { 
    126126 
     
    147147    // NULL値が必要な場合 
    148148    function setItemTermWithNull($arr, $ItemStr) { 
    149  
    150         $item = " ${ItemStr} IS NULL "; 
     149        $return = array(); 
     150        $item = " {$ItemStr} IS NULL "; 
    151151 
    152152        if ($arr) { 
    153153            foreach ($arr as $data) { 
    154154                if ($data != '不明') { 
    155                     $item .= " OR ${ItemStr} = ?"; 
     155                    $item .= " OR {$ItemStr} = ?"; 
    156156                    $return[] = $data; 
    157157                } 
     
    159159        } 
    160160 
    161         $item = "(${item}) "; 
     161        $item = "({$item}) "; 
    162162        $this->setWhere($item); 
    163163        return $return; 
     
    165165    // NULLもしくは''で検索する場合 
    166166    function setItemTermWithNullAndSpace($arr, $ItemStr) { 
     167        $return = array(); 
    167168        $count = count($arr); 
    168         $item = " ${ItemStr} IS NULL OR ${ItemStr} = '' "; 
     169        $item = " {$ItemStr} IS NULL OR {$ItemStr} = '' "; 
    169170        $i = 1; 
    170171        if ($arr) { 
    171172            foreach ($arr as $data) { 
    172173                if ($i == $count) break; 
    173                 $item .= " OR ${ItemStr} = ?"; 
     174                $item .= " OR {$ItemStr} = ?"; 
    174175                $return[] = $data; 
    175176                $i ++; 
    176177            } 
    177178        } 
    178         $item = "(${item}) "; 
     179        $item = "({$item}) "; 
    179180        $this->setWhere($item); 
    180181        return $return; 
Note: See TracChangeset for help on using the changeset viewer.