Tag: ejs bookshelf.js

随着bookshelf.js,我如何更新primefaces模型logging?

我与JOB模型和许多TASK有一对多的关系。 我有一个单独的任务的路线,我从中获取TASK模型显示,并从其JOB模型的一些数据。 当我请求一个任务时,我需要更新locking的和一个user_id字段,以便我可以locking任务并显示locking的人员,以便其他用户无法访问该任务视图。 因此,我需要保证任务已locking= 0,并立即用时间戳更新该字段。 我目前的路由器代码是: var route_task = function(req, res, next) { new Model.Task({id: req.params.id}).fetch(withRelated: ['jobs']}) .then(function(task) { if (!task) { res.status(404); res.render('404_tpl'); return; } if (task.get('locked') !== 0) { res.status(403); res.render('403_tpl', {title: '403 – Access Denied – Task is locked'}); return; } else { /* I would update it here, but there's a […]