Relatório funcinal com datas formatadas
							parent
							
								
									1b4347d585
								
							
						
					
					
						commit
						2e0f41769b
					
				| 
						 | 
				
			
			@ -44,13 +44,21 @@ const ShowTicketReport = async (id: string | number, startDate: string, endDate:
 | 
			
		|||
  const ticket = await Ticket.findAll({  
 | 
			
		||||
 | 
			
		||||
    where: where_clause ,
 | 
			
		||||
    attributes: ['id', 'status', 'createdAt', 'updatedAt'],
 | 
			
		||||
    //attributes: ['id', 'status', 'createdAt', 'updatedAt'],
 | 
			
		||||
 | 
			
		||||
    attributes: ['id', 'status', [Sequelize.fn("DATE_FORMAT",Sequelize.col("Ticket.createdAt"),"%d/%m/%Y %H:%i:%s"),"createdAt"], 
 | 
			
		||||
    [Sequelize.fn("DATE_FORMAT",Sequelize.col("Ticket.updatedAt"),"%d/%m/%Y %H:%i:%s"),"updatedAt"]],
 | 
			
		||||
 | 
			
		||||
    include: [
 | 
			
		||||
      {
 | 
			
		||||
        model: Message,
 | 
			
		||||
        required:true,
 | 
			
		||||
        separate: true,
 | 
			
		||||
        attributes: ['body', 'read', 'mediaType','fromMe', 'mediaUrl','createdAt'], 
 | 
			
		||||
        
 | 
			
		||||
        // attributes: ['body', 'read', 'mediaType','fromMe', 'mediaUrl','createdAt'],
 | 
			
		||||
 | 
			
		||||
       attributes: ['body', 'read', 'mediaType','fromMe', 'mediaUrl', [Sequelize.fn("DATE_FORMAT",Sequelize.col("createdAt"),"%d/%m/%Y %H:%i:%s"),"createdAt"]],
 | 
			
		||||
 | 
			
		||||
        order: [
 | 
			
		||||
          ['createdAt', 'ASC']
 | 
			
		||||
        ]  
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -218,9 +218,9 @@ const Report = () => {
 | 
			
		|||
      const fetchQueries = async () => {
 | 
			
		||||
        try {
 | 
			
		||||
 | 
			
		||||
          /*const  dataQuery  = await api.get("/reports/", {params: {userId, startDate, endDate },}); 
 | 
			
		||||
          const  dataQuery  = await api.get("/reports/", {params: {userId, startDate, endDate },}); 
 | 
			
		||||
          dispatchQ({ type: "RESET" })
 | 
			
		||||
          dispatchQ({ type: "LOAD_QUERY", payload: dataQuery.data }); */
 | 
			
		||||
          dispatchQ({ type: "LOAD_QUERY", payload: dataQuery.data }); 
 | 
			
		||||
 | 
			
		||||
          setLoading(false);
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue