common/models/traits/base/SlugTypeTrait.php
public static function queryBySlug( $slug, $config = [] ) {

		$ignoreSite	= isset( $config[ 'ignoreSite' ] ) ? $config[ 'ignoreSite' ] : false;

		if( static::isMultiSite() && !$ignoreSite ) {

			$siteId	= isset( $config[ 'siteId' ] ) ? $config[ 'siteId' ] : Yii::$app->core->siteId;

			return static::find()->where( 'slug=:slug AND siteId=:siteId', [ ':slug' => $slug, ':siteId' => $siteId ] );
		}
		else {

			return static::find()->where( 'slug=:slug', [ ':slug' => $slug ] );
		}
	}
public static function queryBySlug( $slug, $config = [] ) {

		$ignoreSite	= isset( $config[ 'ignoreSite' ] ) ? $config[ 'ignoreSite' ] : false;

		if( static::isMultiSite() && !$ignoreSite ) {

			$siteId	= isset( $config[ 'siteId' ] ) ? $config[ 'siteId' ] : Yii::$app->core->siteId;

			return static::find()->where( 'slug=:slug AND siteId=:siteId', [ ':slug' => $slug, ':siteId' => $siteId ] );
		}
		else {

			return static::find()->where( 'slug=:slug', [ ':slug' => $slug ] );
		}
	}
public static function queryBySlug ( $ slug , $ config = [ ] ) { $ ignoreSite = isset ( $ config [ 'ignoreSite' ] ) ? $ config [ 'ignoreSite' ] : false ; if ( static :: isMultiSite ( ) && ! $ ignoreSite ) { $ siteId = isset ( $ config [ 'siteId' ] ) ? $ config [ 'siteId' ] : Yii :: $ app -> core -> siteId ; return static :: find ( ) -> where ( 'slug=:slug AND siteId=:siteId' , [ ':slug' => $ slug , ':siteId' => $ siteId ] ) ; } else { return static :: find ( ) -> where ( 'slug=:slug' , [ ':slug' => $ slug ] ) ; } }
Return query to find the models by given slug.

@param string $slug
@param array $config
@return \yii\db\ActiveQuery to query by slug.
Return query to find the models by given slug .