I want to implement a sql query in the following way:
INNER JOIN `Product_has_ProductFeature` t ON `Product`.`id` = t.`productId` AND t.`productFeatureValueI
innerJoin() is a method from the Query class.
innerJoin()
You can try something like this.
$query = new \yii\db\Query; $command = $query->innerJoin( 'Product_has_ProductFeature', `Product`.`id` = t.`productId`) ->andWhere('t.`productFeatureValueId` = 1') ->createCommand(); $queryResult = $command->query();