Ignore:
Timestamp:
2011/10/02 04:22:08 (9 years ago)
Author:
Seasoft
Message:

#1488 (SC_SelectSql#selectTermRange がプレースホルダを使っていない)
#1449 (不要な関数・処理の整理)

File:
1 edited

Legend:

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

    r20764 r21269  
    8888    //-- 期間検索(○年○月○日か~○年○月○日まで) 
    8989    function selectTermRange($from_year, $from_month, $from_day, $to_year, $to_month, $to_day, $column) { 
     90        $return = array(); 
    9091 
    9192        // 開始期間の構築 
     
    102103        // 開始期間だけ指定の場合 
    103104        if( ( $from_year != "" ) && ( $from_month != "" ) && ( $from_day != "" ) && ( $to_year == "" ) && ( $to_month == "" ) && ( $to_day == "" ) ) { 
    104             $this->setWhere( $column ." >= '" . $date1 . "'"); 
     105            $this->setWhere( $column .' >= ?'); 
     106            $return[] = $date1; 
    105107        } 
    106108 
     
    108110        if( ( $from_year != "" ) && ( $from_month != "" ) && ( $from_day != "" ) && 
    109111            ( $to_year != "" ) && ( $to_month != "" ) && ( $to_day != "" ) ) { 
    110             $this->setWhere( $column ." >= '" . $date1 ."' AND ". $column . " < date('" . $date2 . "')" ); 
     112            $this->setWhere( $column . ' >= ? AND ' . $column . ' < date(?)' ); 
     113            $return[] = $date1; 
     114            $return[] = $date2; 
    111115        } 
    112116 
    113117        // 終了期間だけ指定の場合 
    114118        if( ( $from_year == "" ) && ( $from_month == "" ) && ( $from_day == "" ) && ( $to_year != "" ) && ( $to_month != "" ) && ( $to_day != "" ) ) { 
    115             $this->setWhere( $column ." < date('" . $date2 . "')"); 
    116         } 
     119            $this->setWhere( $column . ' < date(?)'); 
     120            $return[] = $date2; 
     121        } 
     122 
     123        return $return; 
    117124    } 
    118125 
Note: See TracChangeset for help on using the changeset viewer.