Комментарии:
Saved me ! Thanks
ОтветитьThanks
ОтветитьThanks a million!
Ответитьhi povilas, was wondering, is it possible to get sum of quantity (order_product pivot table) * price (products table) for desired order_id (order_product pivot table)
ОтветитьHow would you calculate a sum of two columns multiplied? Like price and amount ( qty )
ОтветитьThanks as always!
ОтветитьThnx so much, I was stuck on this for a bit
ОтветитьAmazing
ОтветитьHello sir, Thank you very much for your great tutorials, I have a problem with displaying mysql column value in my page for example I have a profile table each user has different title such as ( Manager, Hr, Finance, teachers, and parents) I know how to count all table and know how many users are registered in my DB but I want to count each title in a separate line like ( total number of teachers, total number of parents or etc.) please help me how to do it. Thank you very much and appreciate your help in advance. V/r, Pardis
ОтветитьIs there a way to do the withSum but with a calculation on two columns?
For example if you have an order table and a product_lines table. The product_line table contains price and quantity. How would you calculate the total amount of the order if order total amount = sum of (product_line_price * product_line_quantity)?
WithSum('products as totalItems', '.....') to change the name.
ОтветитьHi Mr. Pavilas, I have a question about the best way to store the product price which has more than size or may be one size, for example pizza or burgers
ОтветитьGoooood
Ответитьwill this work on laravel 7 ? withSum() ? I need total in datatable . For now i'm doing by foreach loop and was searching for efficient way
ОтветитьThis design is flawed by design. In a POS you would usually have Order->OrderRow that would have a relation to Product or anything else. This is because sometimes you need to discount a row of an Order, not a specific product.
ОтветитьThanks for responding to email. Much appreciated
ОтветитьIt's a shame we didn't get to see the resulting query that Eloquent produced for the counts. Great tip!
ОтветитьThank You Povilas, I just needed this feature for my work !
Ответить