コード例 #1
0
ファイル: db.php プロジェクト: my1977/shopnc
 public function select($options = array())
 {
     static $_cache = array();
     $sql = $this->buildSelectSql($options);
     if ($options['cache'] !== FALSE) {
         $key = is_string($cache['cache_key']) ? $cache['cache_key'] : md5($sql);
         if (isset($_cache[$key])) {
             return $_cache[$key];
         }
     }
     $result = DB::getall($sql);
     if ($options['cache'] !== FALSE && !isset($_cache[$key])) {
         $_cache[$key] = $result;
     }
     return $result;
 }
コード例 #2
0
ファイル: model.php プロジェクト: my1977/shopnc
 public function query($sql)
 {
     return DB::getall($sql);
 }