mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-18 09:52:17 +09:00
1. column 정리 부분 중 불필요한 부분 정리. 2. column 정리시 중복된 함수 및 비교문 등(괄호가 중첩되는 경우)이 있는 경우 그냥 넘기도록 함. 3. column 정리시 테이블.필드 형식이 아닌 필드명을 함수에 넘길 경우에 큰따음표로 싸지 않는 문제가 발견되어 수정. 4. column 정리시 함수에 쉼표(,)로 구분되는 다중 인자를 넘기는 경우 필드명 등은 큰따음표로 싸고 숫자는 그냥 넘기도록 수정. git-svn-id: http://xe-core.googlecode.com/svn/sandbox@7558 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
0693d8fd10
commit
beb90d7e5d
1 changed files with 35 additions and 14 deletions
|
|
@ -668,23 +668,44 @@
|
|||
} else {
|
||||
if(strpos($name,'.')!=false) {
|
||||
list($prefix, $name) = explode('.',$name);
|
||||
if (strpos ($prefix, "(")) {
|
||||
$tmpval = explode ("(", $prefix);
|
||||
$tmpval[1] = sprintf ('"%s"', $tmpval[1]);
|
||||
$prefix = implode ("(", $tmpval);
|
||||
$flag_of_function = true;
|
||||
if (($now_matchs = preg_match_all ("/\(/", $prefix, $xtmp)) > 0) {
|
||||
if ($now_matchs == 1) {
|
||||
$tmpval = explode ("(", $prefix);
|
||||
$tmpval[1] = sprintf ('"%s"', $tmpval[1]);
|
||||
$prefix = implode ("(", $tmpval);
|
||||
$tmpval = explode (")", $name);
|
||||
$tmpval[0] = sprintf ('"%s"', $tmpval[0]);
|
||||
$name = implode (")", $tmpval);
|
||||
}
|
||||
}
|
||||
else $prefix = sprintf('"%s"',$prefix);
|
||||
if ($flag_of_function === true) {
|
||||
$tmpval = explode (")", $name);
|
||||
$tmpval[0] = sprintf ('"%s"', $tmpval[0]);
|
||||
$name = implode (")", $tmpval);
|
||||
$flag_of_function = false;
|
||||
else {
|
||||
$prefix = sprintf('"%s"',$prefix);
|
||||
$name = ($name == '*') ? $name : sprintf('"%s"',$name);
|
||||
}
|
||||
else $name = ($name == '*') ? $name : sprintf('"%s"',$name);
|
||||
|
||||
$xtmp = null;
|
||||
$now_matchs = null;
|
||||
$column_list[] = sprintf($click_count,sprintf('%s.%s', $prefix, $name)) . ($alias ? sprintf(' as %s',$alias) : '');
|
||||
|
||||
} elseif (($now_matchs = preg_match_all ("/\(/", $name, $xtmp)) > 0) {
|
||||
if ($now_matchs == 1 && preg_match ("/[a-zA-Z0-9]*\(\*\)/", $name) < 1) {
|
||||
$open_pos = strpos ($name, "(");
|
||||
$close_pos = strpos ($name, ")");
|
||||
if (preg_match ("/,/", $name)) {
|
||||
$tmp_func_name = sprintf ('%s', substr ($name, 0, $open_pos));
|
||||
$tmp_params = sprintf ('%s', substr ($name, $open_pos + 1, $close_pos - $open_pos - 1));
|
||||
$tmpval = null;
|
||||
$tmpval = explode (',', $tmp_params);
|
||||
foreach ($tmpval as $tmp_param) {
|
||||
$tmp_param_list[] = (!is_numeric ($tmp_param)) ? sprintf ('"%s"', $tmp_param) : $tmp_param;
|
||||
}
|
||||
$tmpval = implode (',', $tmp_param_list);
|
||||
$name = sprintf ('%s(%s)', $tmp_func_name, $tmpval);
|
||||
} else {
|
||||
$name = sprintf ('%s("%s")',
|
||||
substr ($name, 0, $open_pos),
|
||||
substr ($name, $open_pos + 1, $close_pos - $open_pos - 1));
|
||||
}
|
||||
}
|
||||
$column_list[] = sprintf ($click_count,$name) . ($alias ? sprintf (' as %s', $alias) : '');
|
||||
} else {
|
||||
$column_list[] = sprintf($click_count,$name) . ($alias ? sprintf(' as %s',$alias) : '');
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue