mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-22 05:15:29 +09:00
Fixed condition group bug.
git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0-DB@8394 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
c40ccf777f
commit
4d2d18b53b
9 changed files with 178 additions and 19 deletions
|
|
@ -14,7 +14,11 @@
|
|||
}
|
||||
|
||||
function toString(){
|
||||
return $this->pipe . ' ' . $this->getConditionPart($this->column_name, $this->value, $this->operation);
|
||||
return $this->pipe . ' ' . $this->getConditionPart();
|
||||
}
|
||||
|
||||
function setPipe($pipe){
|
||||
$this->pipe = $pipe;
|
||||
}
|
||||
|
||||
function show(){
|
||||
|
|
@ -42,8 +46,13 @@
|
|||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
function getConditionPart($name, $value, $operation) {
|
||||
|
||||
function getConditionPart() {
|
||||
|
||||
$name = $this->column_name;
|
||||
$value = $this->value;
|
||||
$operation = $this->operation;
|
||||
|
||||
switch($operation) {
|
||||
case 'equal' :
|
||||
return $name.' = '.$value;
|
||||
|
|
|
|||
|
|
@ -11,12 +11,17 @@
|
|||
|
||||
function toString(){
|
||||
if($this->pipe !== "")
|
||||
$group = $this->pipe .'(';
|
||||
$group = $this->pipe .' (';
|
||||
else $group = '';
|
||||
|
||||
$cond_indx = 0;
|
||||
|
||||
foreach($this->conditions as $condition){
|
||||
if($condition->show())
|
||||
if($condition->show()){
|
||||
if($cond_indx === 0) $condition->setPipe("");
|
||||
$group .= $condition->toString() . ' ';
|
||||
$cond_indx++;
|
||||
}
|
||||
}
|
||||
|
||||
if($this->pipe !== "")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue