How to join two tables in Pyrocms

48 Views Asked by At

I am new to pyrocms, I want to join two tables in pyrocms. My two tables are milege and products. How to join this two table in pyrocms What I have tried is:

 {% set table_data=query().from('milege).join('products').on('milege.id','=','product.mid').where('user_id','1').get() %}

I am getting errors on executing this query. How to join these two table data in pyrocms.

1

There are 1 best solutions below

0
Ryan Thompson On

You are missing a single quote in your code, but to answer your question, it mirrors the Laravel query builder:

{% set results = query().from('mileage').join('products', 'milege.id', '=', 'product.mid').where('user_id','1').get() %}