Skip to content

Commit 574841d

Browse files
committed
Merge pull request #33 from proditis/master
Fix bug that introduced by the change in model()->deleteAll()
2 parents 20f9d0b + d8a3470 commit 574841d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

htdocs/protected/modules/syslog/models/Syslog.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,10 @@ public function search()
187187

188188
if($this->acknowledge!==false)
189189
{
190-
$cmd = Yii::app()->db->createCommand("DELETE syslog.* FROM syslog LEFT JOIN host ON host.id=syslog.host WHERE ".$criteria->condition);
190+
if($criteria->condition!="")
191+
$cmd = Yii::app()->db->createCommand("DELETE syslog.* FROM syslog LEFT JOIN host ON host.id=syslog.host WHERE ".$criteria->condition);
192+
else
193+
$cmd = Yii::app()->db->createCommand("DELETE syslog.* FROM syslog");
191194
foreach($criteria->params as $key=>$val) $cmd->bindParam($key,$val);
192195
$cmd->execute();
193196
// Syslog::model()->deleteAll($criteria->condition,$criteria->params);

0 commit comments

Comments
 (0)