Merge branch 'zenops_46' into zenops_46_tanghucheng

This commit is contained in:
tanghucheng
2022-11-29 14:20:45 +08:00
482 changed files with 11175 additions and 3313 deletions
+14 -8
View File
@@ -214,17 +214,25 @@ class zanodemodel extends model
}
/**
* Update Node attribute.
* Update Node.
*
* @param int $id
* @param array $data
* @return void
*/
public function update($id, $data)
public function update($id)
{
$this->dao->update(TABLE_ZAHOST)->data($data)
->where('id')->eq($id)
->exec();
$oldHost = $this->getNodeById($id);
$hostInfo = fixer::input('post')->get();
$hostInfo->editedBy = $this->app->user->account;
$hostInfo->editedDate = helper::now();
$this->dao->update(TABLE_ZAHOST)->data($hostInfo)
->batchCheck($this->config->zanode->edit->requiredFields, 'notempty');
if(dao::isError()) return false;
$this->dao->update(TABLE_ZAHOST)->data($hostInfo)->autoCheck()
->where('id')->eq($id)->exec();
return common::createChanges($oldHost, $hostInfo);
}
/**
@@ -446,8 +454,6 @@ class zanodemodel extends model
$params = "id=$node->id";
$menu .= $this->buildMenu('zanode', 'edit', $params, $node, 'view');
$params = "id=$node->id";
$menu .= $this->buildMenu('zanode', 'delete', $params, $node, 'view', 'trash', 'hiddenwin');
return $menu;