Skip to content
Browse files

createCountCommand(): wrong matches were used.

  • Loading branch information...
1 parent 551c42b commit fc666775fef44ebec275bd742e3d847fa85cb0b1 @resurtm resurtm committed Sep 16, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 framework/db/schema/CDbCommandBuilder.php
View
4 framework/db/schema/CDbCommandBuilder.php
@@ -158,7 +158,7 @@ public function createCountCommand($table,$criteria,$alias='t')
preg_match_all('/(:\w+)/',$sql,$params1);
$params2=array();
preg_match_all('/(:\w+)/',$this->applyOrder($sql,$criteria->order),$params2);
- foreach(array_diff($params2[0],$params1[1]) as $param)
+ foreach(array_diff($params2[0],$params1[0]) as $param)
unset($criteria->params[$param]);
}
@@ -169,7 +169,7 @@ public function createCountCommand($table,$criteria,$alias='t')
preg_match_all('/(:\w+)/',$sql,$params1);
$params2=array();
preg_match_all('/(:\w+)/',$sql.' '.(is_array($criteria->select) ? implode(', ',$criteria->select) : $criteria->select),$params2);
- foreach(array_diff($params2[0],$params1[1]) as $param)
+ foreach(array_diff($params2[0],$params1[0]) as $param)
unset($criteria->params[$param]);
}

0 comments on commit fc66677

Please sign in to comment.
Something went wrong with that request. Please try again.