Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

91
Visualizações
Calculate the number of reservations for 1 day

I'm stuck on the calculation of the number of reservations made during the day. People can book up to 4 covers, the capacity of the restaurant is 40 covers. I can't check to see if there's room left. I have a sql query to retrieve the reservations for the day, then I block on the reservations for the days to retrieve the number of covers for each reservation. How do I add the number of covers for all the reservations for the day? I'm going to check this on the backend side with nodejs and express js.

Thank you in advance for your help

exports.createReservation = (req,res)=>{

const {numeroReservation, id_user, idBoutique, horaire, dateReservation, nombreCouverts} = req.body;

 connection.query(reservation.getAllReservationByIdBoutiqueDateReservation,[idBoutique,dateReservation],(error,result)=>{
   for(var i =0,len = result.length; i< len; i++){
            const test = result[i].nombreCouverts * result[i].nombreCouverts
             console.log(test)
             
        }
  }
}

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda