merisor

Experience

50

0 Best Reply Awards

  • Member Since 6 Months Ago
  • 0 Lessons Completed
  • 0 Favorites

21st March, 2018

merisor started a new conversation Model Relation With Multiple Keys • 6 months ago

Hey guys,

This is probably trivial but i couldn't find an answer.

Let's say I have three Models

Order (order_id) OrderItems (order_id, item_id) OrderPromotion(order_id,item_id, other_fields)

Is there any way to make a relation from OrderItems to OrderPromotion

to be equivalent of select * from OrderPromotion where order_id = 11232 and item_id = 23432

thanks

Edit Your Profile
Update

Want to change your profile photo? We pull from gravatar.com.