diff --git a/frontend/modules/api/models/Target.php b/frontend/modules/api/models/Target.php index aa48d3199..96be7e0e8 100644 --- a/frontend/modules/api/models/Target.php +++ b/frontend/modules/api/models/Target.php @@ -40,10 +40,11 @@ public function afterFind() if (Yii::$app->user->identity->instance) $this->ip = long2ip(Yii::$app->user->identity->instance->ip); else if($this->ondemand && $this->ondemand->state==1) - { $this->ip = long2ip($this->ip); - } + else if($this->ondemand && $this->ondemand->state!=1) + $this->ip = long2ip(0); else - $this->ip=0; - } + $this->ip=long2ip($this->ip); + } + }