This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.
I have three tables: Orders (id) Order_product_list (id, order_id, product_id, price) Product (id, price)
Only I need that-be price from Product.Price placed Order_product_list.Price .
Tell me how to do it? Which plugins have such a relationship? Thank you!
Hi,
What you search for is pivot data. Check documentation here:
http://octobercms.com/docs/backend/relations#belongs-to-many-pivot
Hi Crazymodder, thank you for your answer
Yes, i found this relation in documentation. But there is nothing said about 'automatics write data to pivot table'. With 'pivot' I can write this value only by hand. But I need automatically
Sure you can,
Simply do somethink like this in your attach:
attach(1, array('price' => $your_pivot_price));
Last updated
1-4 of 4