time production

This commit is contained in:
Vicente Falco 2017-07-12 08:21:36 +02:00
parent 62b0a29f7c
commit ace002e02b
1 changed files with 2 additions and 2 deletions

View File

@ -21,10 +21,10 @@ module.exports = function(Ticket) {
Ticket.changeTime = function(ctx, time, cb) { Ticket.changeTime = function(ctx, time, cb) {
var tickets = ctx.req.body.tickets; var tickets = ctx.req.body.tickets;
var FakeProduction = Ticket.app.models.FakeProduction; var FakeProduction = Ticket.app.models.FakeProduction;
var hour = `${time}`; var hour = `${time}:00`;
var query = `update Ticket set date = CONCAT(DATE(date), ' ', ?) where id in (?)`; var query = `update Ticket set date = CONCAT(DATE(date), ' ', ?) where id in (?)`;
var params = [time, tickets]; var params = [hour, tickets];
FakeProduction.updateAll({ticketFk: {inq: tickets}}, {hour: hour}, function(err, res){ FakeProduction.updateAll({ticketFk: {inq: tickets}}, {hour: hour}, function(err, res){
if(err) if(err)