mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-13 15:32:15 +09:00
add "click count -incr()" for Cubrid Xml Query
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@6826 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
fb9f2dd4a4
commit
314700badd
2 changed files with 52 additions and 50 deletions
|
|
@ -113,7 +113,6 @@
|
|||
$output->page_count = $out->page_count;
|
||||
$output->page = $out->page;
|
||||
|
||||
|
||||
$column_count = count($output->columns);
|
||||
$condition_count = count($output->conditions);
|
||||
|
||||
|
|
@ -125,7 +124,6 @@
|
|||
}
|
||||
$buff .= ' );'."\n";
|
||||
|
||||
|
||||
// php script 생성
|
||||
$buff .= '$output->_tables = array( ';
|
||||
foreach($output->tables as $key => $val) {
|
||||
|
|
@ -133,8 +131,6 @@
|
|||
}
|
||||
$buff .= ' );'."\n";
|
||||
|
||||
|
||||
|
||||
if(count($output->left_tables)){
|
||||
$buff .= '$output->left_tables = array( ';
|
||||
foreach($output->left_tables as $key => $val) {
|
||||
|
|
@ -143,7 +139,6 @@
|
|||
$buff .= ' );'."\n";
|
||||
}
|
||||
|
||||
|
||||
// column 정리
|
||||
if($column_count) {
|
||||
$buff .= '$output->columns = array ( ';
|
||||
|
|
@ -169,8 +164,6 @@
|
|||
$buff .= ' );'."\n";
|
||||
}
|
||||
|
||||
|
||||
|
||||
// order 정리
|
||||
if($output->order) {
|
||||
$buff .= '$output->order = array(';
|
||||
|
|
@ -247,11 +240,7 @@
|
|||
FileHandler::writeFile($cache_file, $buff);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
function _setColumn($columns){
|
||||
|
||||
if(!$columns) {
|
||||
$output->column[] = array("*" => "*");
|
||||
} else {
|
||||
|
|
@ -274,13 +263,13 @@
|
|||
"minlength" => $val->attrs->minlength,
|
||||
"maxlength" => $val->attrs->maxlength,
|
||||
"alias" => $val->attrs->alias,
|
||||
"click_count" => $val->attrs->click_count,
|
||||
);
|
||||
}
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
function _setConditions($conditions){
|
||||
// 조건절 정리
|
||||
|
||||
|
|
@ -359,35 +348,50 @@
|
|||
return $output;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
function _getColumn($columns){
|
||||
$buff = '';
|
||||
$str = '';
|
||||
$print_vars = array();
|
||||
|
||||
foreach($columns as $key => $val) {
|
||||
$str = 'array("name"=>"%s","alias"=>"%s"';
|
||||
$print_vars = array();
|
||||
$print_vars[] = $val['name'];
|
||||
$print_vars[] = $val['alias'];
|
||||
|
||||
$val['default'] = $this->getDefault($val['name'], $val['default']);
|
||||
if($val['var'] && strpos($val['var'],'.')===false) {
|
||||
|
||||
if($val['default']) $buff .= sprintf('array("name"=>"%s", "alias"=>"%s", "value"=>$args->%s?$args->%s:%s),%s', $val['name'], $val['alias'], $val['var'], $val['var'], $val['default'] ,"\n");
|
||||
else $buff .= sprintf('array("name"=>"%s", "alias"=>"%s", "value"=>$args->%s),%s', $val['name'], $val['alias'], $val['var'], "\n");
|
||||
if($val['default']){
|
||||
$str .= ',"value"=>$args->%s?$args->%s:%s';
|
||||
$print_vars[] = $val['var'];
|
||||
$print_vars[] = $val['var'];
|
||||
$print_vars[] = $val['default'];
|
||||
}else{
|
||||
$str .= ',"value"=>$args->%s';
|
||||
$print_vars[] = $val['var'];
|
||||
}
|
||||
|
||||
if($val['default']) $default_list[$val['var']] = $val['default'];
|
||||
if($val['notnull']) $notnull_list[] = $val['var'];
|
||||
if($val['minlength']) $minlength_list[$val['var']] = $val['minlength'];
|
||||
if($val['maxlength']) $maxlength_list[$val['var']] = $val['maxlength'];
|
||||
} else {
|
||||
if($val['default']) $buff .= sprintf('array("name"=>"%s", "alias"=>"%s", "value"=>%s),%s', $val['name'], $val['alias'], $val['default'] ,"\n");
|
||||
else $buff .= sprintf('array("name"=>"%s", "alias"=>"%s",),%s', $val['name'], $val['alias'], "\n");
|
||||
if($val['default']){
|
||||
$str .= ',"value"=>%s';
|
||||
$print_vars[] = $val['default'];
|
||||
}
|
||||
}
|
||||
|
||||
if($val['click_count']){
|
||||
$str .= ',"click_count"=>$args->%s';
|
||||
$print_vars[] = $val['click_count'];
|
||||
}
|
||||
|
||||
$str .= '),%s';
|
||||
$print_vars[] = "\n";
|
||||
|
||||
$buff .= vsprintf($str, $print_vars);
|
||||
}
|
||||
return $buff;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
function _getConditions($conditions){
|
||||
$buff = '';
|
||||
foreach($conditions as $key => $val) {
|
||||
|
|
@ -414,12 +418,6 @@
|
|||
return $buff;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @brief column, condition등의 key에 default 값을 세팅
|
||||
**/
|
||||
|
|
@ -449,8 +447,7 @@
|
|||
$args = abs($args);
|
||||
if ($db_info->db_type == 'cubrid') {
|
||||
$val = sprintf ('"\\"%s\\"+%d"', $name, $args);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$val = sprintf('"%s+%d"', $name, $args);
|
||||
}
|
||||
break;
|
||||
|
|
@ -458,17 +455,15 @@
|
|||
$args = abs($args);
|
||||
if ($db_info->db_type == 'cubrid') {
|
||||
$val = sprintf ('"\\"%s\\"-%d"', $name, $args);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$val = sprintf('"%s-%d"', $name, $args);
|
||||
}
|
||||
break;
|
||||
case 'multiply' :
|
||||
$args = intval($args);
|
||||
$args = intval($args);
|
||||
if ($db_info->db_type == 'cubrid') {
|
||||
$val = sprintf ('"\\"%s\\"*%d"', $name, $args);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$val = sprintf('"%s*%d"', $name, $args);
|
||||
}
|
||||
break;
|
||||
|
|
@ -476,6 +471,5 @@
|
|||
|
||||
return $val;
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue