Sum of working time of several employees

Asked

Viewed 93 times

0

I have a collaborators table, and other 2 activity tables, each with a column of time used to perform that activity and I would like to add these tables to know the total time, example, employee A did 10 hours in a project (table 1) and another 10 hours in parallel activities (Table 2), add the two and stay 20 hours.

I’m using Laravel, my question is how to do this using the Eloquent ORM. I’m a little stuck in logic, need to use relationship Many to Many? do you have any example? I thank you.

inserir a descrição da imagem aqui

  • Opa Carlos!? Put the structure of the tables you want to make the relationship. This way the people will have greater vision to help you

  • Ready Walmir, it is not exactly the name of the fields, but the structure is the same.

  • Are you trying to add tempo_atv_proj with tempo_atv_ext of a certain coladorador_id? you created the Eloquent classes?

  • This Virgilio, I want to add these columns of time, I created only the models of each haha, nothing else.

  • @Carloseduardosilva if you can put these models?

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.