yii2, где в

public function static findProductsOnSale($ids)
{
    return $this->find()->where(['in', 'product_id', $ids])->count();
}
Purple Team