* Fix issue.

This commit is contained in:
tanghucheng
2022-12-26 10:42:44 +08:00
parent fde26c3abf
commit b291f3cc95
3 changed files with 8 additions and 8 deletions
+4 -4
View File
@@ -327,18 +327,18 @@ class zanodemodel extends model
->orderBy($orderBy)
->page($pager)
->fetchAll();
$hostIDList = array_column($list, 'parent');
$hosts = $this->dao->select('id,status,heartbeat')->from(TABLE_ZAHOST)
->where('id')->in(array_unique($hostIDList))
->fetchAll('id');
foreach($list as $l)
{
$host = zget($hosts, $l->parent);
if($l->status == 'running' || $l->status == 'ready')
{
if(empty($host))
if(empty($host))
{
$l->status = self::STATUS_SHUTOFF;
continue;
@@ -548,7 +548,7 @@ class zanodemodel extends model
->where('mac')->eq($mac)
->andWhere("type")->eq('node')
->fetch();
$host = $this->loadModel("zahost")->getByID($node->parent);
if($node->status == 'running' || $node->status == 'ready')
{