* Merge 18 devopos to 20

This commit is contained in:
zenggang
2023-10-07 03:03:28 +00:00
parent 4e535ae301
commit 10a61396a1
196 changed files with 3646 additions and 940 deletions
+6 -4
View File
@@ -83,7 +83,7 @@ class hostModel extends model
$modules = $param ? $this->loadModel('tree')->getAllChildId($param) : '0';
}
$orderBy = str_replace($orderBy, 't1.', '');
$orderBy = str_replace('t1.', '', $orderBy);
$host = $this->dao->select('*,id as hostID')->from(TABLE_HOST)
->where('deleted')->eq('0')
->andWhere('type')->eq('normal')
@@ -157,11 +157,13 @@ class hostModel extends model
->setDefault('cpuNumber,cpuCores,diskSize,memory', 0)
->get();
$hostInfo->admin = intval($hostInfo->admin);
$hostInfo->serverRoom = intval($hostInfo->serverRoom);
$this->dao->update(TABLE_HOST)->data($hostInfo)
->batchCheck($this->config->host->create->requiredFields, 'notempty')
->batchCheck('diskSize,memory', 'float');
if(dao::isError()) return false;
$intFields = explode(',', $this->config->host->create->intFields);
foreach($intFields as $field)
{
@@ -186,7 +188,7 @@ class hostModel extends model
$hostInfo->createdBy = $this->app->user->account;
$hostInfo->createdDate = helper::now();
$this->dao->insert(TABLE_HOST)->data($hostInfo)->autoCheck()->exec();
if(!dao::isError())
if(!dao::isError())
{
$hostID = $this->dao->lastInsertID();
$this->loadModel('action')->create('host', $hostID, 'created');
@@ -219,7 +221,7 @@ class hostModel extends model
->batchCheck($this->config->host->create->requiredFields, 'notempty')
->batchCheck('diskSize,memory', 'float');
if(dao::isError()) return false;
$intFields = explode(',', $this->config->host->create->intFields);
foreach($intFields as $field)
{