public function getField($field,$sepa=null) { $options['field'] = $field; $options = $this->_parseOptions($options); // 判斷查詢快取 if(isset($options['cache'])){ $cache = $options['cache']; 這裡獲取快取標示符 $key = is_string($cache['key'])?$cache['key']:md5($sepa.serialize($options)); $data = S($key,'',$cache); if(false !== $data){ return $data; } }
if(!empty($resultSet)) { $_field = explode(',', $field); $field = array_keys($resultSet[0]); 這裡生成的卻是用的返回的陣列的key $key = array_shift($field); $key2 = array_shift($field); $cols = array(); $count = count($_field); foreach ($resultSet as $result){ $name = $result[$key]; if(2==$count) { $cols[$name] = $result[$key2]; }else{ $cols[$name] = is_string($sepa)?implode($sepa,array_slice($result,1)):$result; } } if(isset($cache)){ S($key,$cols,$cache);
坑了好久才發現,不知道修復了沒有
回覆
感謝提出,已經修正!