28 lines
797 B
JavaScript
28 lines
797 B
JavaScript
/**
|
|
* Run_statusController
|
|
*
|
|
* @description :: Server-side logic for managing run_statuses
|
|
* @help :: See http://sailsjs.org/#!/documentation/concepts/Controllers
|
|
*/
|
|
|
|
module.exports = {
|
|
between: function(req, res){
|
|
var endDtime = new Date(Date.now());
|
|
endDtime = endDtime.toISOString();
|
|
if (req.params.endDtime){
|
|
endDtime = req.params.endDtime;
|
|
}
|
|
var params = {where: {createdAt :{'>=': req.params.startDtime, '<=': endDtime}}};
|
|
Run_status.find(params).exec(function(err, run_status_data){
|
|
if (err) return res.serverError(err);
|
|
return res.ok(run_status_data);
|
|
});
|
|
},
|
|
current: function(req, res){
|
|
Run_status.find({sort: 'id DESC', limit: 1}).exec(function(err, run_status_now){
|
|
if (err) return res.serverError(err);
|
|
res.ok(run_status_now);
|
|
});
|
|
}
|
|
};
|