* fix the bug #212

This commit is contained in:
shiyangyangwork@yahoo.cn
2011-05-08 02:45:43 +00:00
parent f68f06dc16
commit a08e90ab08
+6 -1
View File
@@ -126,7 +126,12 @@ class buildModel extends model
{
$oldBuild = $this->getByID($buildID);
$build = fixer::input('post')->stripTags('name')->get();
$this->dao->update(TABLE_BUILD)->data($build)->autoCheck()->batchCheck($this->config->build->edit->requiredFields, 'notempty')->where('id')->eq((int)$buildID)->check('name','unique')->exec();
$this->dao->update(TABLE_BUILD)->data($build)
->autoCheck()
->batchCheck($this->config->build->edit->requiredFields, 'notempty')
->where('id')->eq((int)$buildID)
->check('name','unique', "id != $buildID")
->exec();
if(!dao::isError()) return common::createChanges($oldBuild, $build);
}
}