I have two tables that I need to gather data from, then add up the sum of one field and return it if the sum is over a certain amount.
Affiliates Table - Table1: [id]
Commissions Table - Table1: [affiliate_id][amount]
I need to grab only affiates where the total commissions 'amount' is over 30.
I will also need to return all of the data from both tables into a single array.