Not sure exactly what you are looking to do here. Are you trying to look for rows of "b" that belong to "a"? You have this:
JOIN b ON a.col = b.col
WHERE b.col = "val"
Did you really mean that you were searching for a different b column? Like WHERE b.col2 = "val"? It might be easier if we were a little less generic with the names. For instance, are you looking to find all the orders for a customer where teh customer ordered a specific item?
SELECT customer.id, order.*
FROM customer
INNER JOIN order ON customer.id = order.customer_id
WHERE order.product_id = 3
Sorry if I'm not understanding, I'm just trying to find out exactly what data you are looking for and the relation between the tables.
If you are looking a a specific customer ("a"), and would like to get a specific subset of orders ("b"), then you can do something like:
$customer = Customers::findFirst($id);
$products = $customer->getOrders('product_id='.$product_id);
The getOrders() function is a magic get that you can use if you have a defined relationship to the Orders model. You will need an Orders model defined. Take a look the docs for further info: https://phalcon-php-framework-documentation.readthedocs.org/en/latest/reference/models.html#taking-advantage-of-relationships