출력 값의 형식을 단순하게 수정

This commit is contained in:
Min-Soo Kim 2020-12-22 17:10:57 +09:00
parent 32d734059d
commit edc674a220

View file

@ -238,8 +238,8 @@ class VariableBase
break; break;
case 'search': case 'search':
$parsed_keywords = $this->_parseSearchKeywords($value); $parsed_keywords = $this->_parseSearchKeywords($value);
$where = $parsed_keywords->where; $where = $parsed_keywords[0];
$params = $parsed_keywords->params; $params = $parsed_keywords[1];
break; break;
case 'plus': case 'plus':
$where = sprintf('%s = %s + %s', $column, $column, $is_expression ? $value : '?'); $where = sprintf('%s = %s + %s', $column, $column, $is_expression ? $value : '?');
@ -436,7 +436,7 @@ class VariableBase
* @param string $value * @param string $value
* @return object * @return object
*/ */
private function _parseSearchKeywords($value) private function _parseSearchKeywords() ($value)
{ {
// parse the value (text) // parse the value (text)
$keywords = preg_split('/("[^"]*")|[\s,]+/', trim($value), 10, \PREG_SPLIT_NO_EMPTY | \PREG_SPLIT_DELIM_CAPTURE); $keywords = preg_split('/("[^"]*")|[\s,]+/', trim($value), 10, \PREG_SPLIT_NO_EMPTY | \PREG_SPLIT_DELIM_CAPTURE);
@ -491,9 +491,6 @@ class VariableBase
$conditions = implode(' ', $conditions); $conditions = implode(' ', $conditions);
$where = count($keywords) === 1 ? $conditions : "($conditions)"; $where = count($keywords) === 1 ? $conditions : "($conditions)";
return (object) array ( return [$where, $params];
'where' => $where,
'params' => $params
);
} }
} }