* fix the error of delayed task.

* quote values in between().
This commit is contained in:
wangchunsheng
2010-11-30 02:08:14 +00:00
parent a6a7cd0e61
commit 4da23bd3bf
2 changed files with 3 additions and 1 deletions
+2
View File
@@ -1428,6 +1428,8 @@ class sql
public function between($min, $max)
{
if($this->inCondition and !$this->conditionIsTrue) return $this;
$min = $this->quote($min);
$max = $this->quote($max);
$this->sql .= " BETWEEN $min AND $max ";
return $this;
}
+1 -1
View File
@@ -306,7 +306,7 @@ class taskModel extends model
->andWhere('t1.deleted')->eq(0)
->beginIF($type == 'needconfirm')->andWhere('t2.version > t1.storyVersion')->andWhere("t2.status = 'active'")->fi()
->beginIF($type == 'assignedtome')->andWhere('t1.assignedTo')->eq($this->app->user->account)->fi()
->beginIF($type == 'delayed')->andWhere('deadline')->lt(helper::now())->fi()
->beginIF($type == 'delayed')->andWhere('deadline')->between('1970-1-1', helper::now())->fi()
->beginIF(strpos('all|needconfirm|assignedtome|delayed', $type) === false)->andWhere('t1.status')->in($type)->fi()
->orderBy($orderBy)
->page($pager)