Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

98
Vistas
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 la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda