Permalink
Browse files

Fix: define table name

  • Loading branch information...
Thoulah committed Feb 6, 2019
1 parent e030601 commit 534141d18a11f741e0f01f0f3b20aa2ff1039db4
Showing with 2 additions and 2 deletions.
  1. +2 −2 mister42/models/lyrics/LyricsQuery.php
@@ -6,10 +6,10 @@ class LyricsQuery extends \yii\db\ActiveQuery {
const STATUS_INACTIVE = '0';
const STATUS_ACTIVE = '1';
public function active($table): self {
public function active(string $table): self {
if (php_sapi_name() === 'cli' || (!Yii::$app->user->isGuest && Yii::$app->user->identity->isAdmin))
return $this->onCondition(['or', [$table.'.active' => [Self::STATUS_INACTIVE, Self::STATUS_ACTIVE]]]);
return $this->onCondition(['active' => Self::STATUS_ACTIVE]);
return $this->onCondition([$table.'.active' => Self::STATUS_ACTIVE]);
}
}

0 comments on commit 534141d

Please sign in to comment.