A
A
Alexander2018-02-21 19:39:11
Laravel
Alexander, 2018-02-21 19:39:11

How to write an ORM request correctly?

There is a base with such structure

Base scheme
7G4KAQjXTPaaBa-1qdT2Lw.png

It is necessary to pull out from the table visitllist 10 last visits of the client, with the given id.
It turns out that you need to find the last active subscription from the client, and already pull out visits from him. How to implement correctly I do not quite understand.
If suddenly the connections are not correct, I will be criticized again. MB some intermediate tables need to be added, or fields

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Antonio Solo, 2018-02-21
@solotony

where is your visitlog table? visitlist?
what is userticket_id and staff_id ? what's in users and what's in ticketslists ?
you need to name user_id and ticketslist_id

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question