* fix the error of release checking.

This commit is contained in:
wangchunsheng
2011-05-02 15:28:43 +00:00
parent d697c5b4ad
commit 5905ebdf22
+6 -1
View File
@@ -75,7 +75,12 @@ class releaseModel extends model
{
$oldRelease = $this->getByID($releaseID);
$release = fixer::input('post')->stripTags('name')->get();
$this->dao->update(TABLE_RELEASE)->data($release)->autoCheck()->batchCheck($this->config->release->edit->requiredFields, 'notempty')->where('id')->eq((int)$releaseID)->check('name','unique')->exec();
$this->dao->update(TABLE_RELEASE)->data($release)
->autoCheck()
->batchCheck($this->config->release->edit->requiredFields, 'notempty')
->check('name','unique', "id != $releaseID")
->where('id')->eq((int)$releaseID)
->exec();
if(!dao::isError()) return common::createChanges($oldRelease, $release);
}
}