* Modify bug model create function.
This commit is contained in:
@@ -345,6 +345,9 @@ class bug extends control
|
||||
$checkExist = $this->bugZen->checkExistBug($bug);
|
||||
if($checkExist['status'] == 'exists') $this->send(array('result' => 'success', 'id' => $checkExist['id'], 'message' => sprintf($this->lang->duplicate, $this->lang->bug->common), 'locate' => $this->createLink('bug', 'view', "bugID={$checkExist['id']}")));
|
||||
|
||||
$bugID = $this->bug->create($bug);
|
||||
if(dao::isError()) $this->send(array('result' => 'fail', 'message' => dao::getError()));
|
||||
|
||||
/* Set from param if there is a object to transfer bug. */
|
||||
setcookie('lastBugModule', (int)$formData->data->module, $this->config->cookieLife, $this->config->webRoot, '', $this->config->cookieSecure, true);
|
||||
|
||||
|
||||
@@ -47,14 +47,14 @@ class bugModel extends model
|
||||
}
|
||||
|
||||
/**
|
||||
* bug的入库操作。
|
||||
* Insert bug into zt_bug.
|
||||
* bug的入库操作
|
||||
*
|
||||
* @param object $bug
|
||||
* @access public
|
||||
* @return array|false
|
||||
* @return int|false
|
||||
*/
|
||||
public function create(object $bug): array|false
|
||||
public function create(object $bug): int|false
|
||||
{
|
||||
$this->dao->insert(TABLE_BUG)->data($bug)
|
||||
->autoCheck()
|
||||
@@ -63,11 +63,7 @@ class bugModel extends model
|
||||
->checkFlow()
|
||||
->exec();
|
||||
|
||||
if(!dao::isError())
|
||||
{
|
||||
$bugID = $this->dao->lastInsertID();
|
||||
return array('status' => 'created', 'id' => $bugID);
|
||||
}
|
||||
if(!dao::isError()) return $this->dao->lastInsertID();
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user