I have two arrays: OrderItem:
[
{
"id": 4,
"cancel": 0,
"deleted_at": null,
"created_at": "2020-08-12T10:14:01.000000Z",
"updated_at": "2020-08-12T10:14:01.000000Z"
},
{
"id": 3,
"cancel": 0,
"created_at": "2020-08-12T10:14:56.000000Z",
"updated_at": "2020-08-12T10:14:56.000000Z",
}
]
OrderReady:
[
{
"id": 2,
"order_item_id": 4,
"date": "1962-04-13",
"wages": 12,
"deleted_at": null,
"created_at": "2020-08-12T10:14:56.000000Z",
"updated_at": "2020-08-12T10:14:56.000000Z",
}
]
So I need to check id from OrderItem table with order_item_id in OrderReady table and return the record from OrderItam table in case the id does not exist in OrderReady table. From the data above, return record with id 3 of OrderItem table, since it does not appear in OrderReady table. What can be the most fastest and efficient way?