$product = Product::find()
->select('product.*')
->from('product')
->leftJoin('categories', '`categories`.`product_id` = `product`.`id`')
->where(['categories.product_id'=> 1])
->with('cat')
->asArray()
->all();