Sum of 2 columns of a relation
I have a model
How can I now show the "value" of an order in a table. With value I mean the sum of all
I tried to use the aggregate functions:
But this gives me obviously only the sum of the prices and ignores the amount of the positions.
doesnt change anything? Any ideas?
Order which hasMany orderPositions. A order position contains the columns product_price and amount. How can I now show the "value" of an order in a table. With value I mean the sum of all
orderPositions prices times it amounts.I tried to use the aggregate functions:
But this gives me obviously only the sum of the prices and ignores the amount of the positions.
doesnt change anything? Any ideas?