Completed job history
This commit is contained in:
@@ -43,6 +43,15 @@ var controllers = {
|
|||||||
res.status(200).json({'status': 'OK', 'internal_return': 0, 'result_list': dist.result,'total_record': dist.total_record })
|
res.status(200).json({'status': 'OK', 'internal_return': 0, 'result_list': dist.result,'total_record': dist.total_record })
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
completedHx: function (req, res) {
|
||||||
|
jobs.completedHx(req, res, function(err, dist) {
|
||||||
|
if (err) {
|
||||||
|
res.send(err);
|
||||||
|
}
|
||||||
|
// res.json(dist);
|
||||||
|
res.status(200).json({'status': 'OK', 'internal_return': 0, 'result_list': dist.result,'total_record': dist.total_record })
|
||||||
|
});
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = controllers;
|
module.exports = controllers;
|
||||||
|
|||||||
@@ -13,4 +13,6 @@ module.exports = function(app) {
|
|||||||
.post(controller.newJobPublish);
|
.post(controller.newJobPublish);
|
||||||
app.route('/contractHx')
|
app.route('/contractHx')
|
||||||
.get(controller.contractHx);
|
.get(controller.contractHx);
|
||||||
|
app.route('/completedHx')
|
||||||
|
.get(controller.completedHx);
|
||||||
};
|
};
|
||||||
@@ -110,6 +110,35 @@ var jobs = {
|
|||||||
next(e.message, null); // pass control to the next handler
|
next(e.message, null); // pass control to the next handler
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
},
|
||||||
|
completedHx: function (req, res, next) {
|
||||||
|
logger.info("------========----------",req.body,"-----------LET SEE ----------");
|
||||||
|
var data = {
|
||||||
|
"member_uid": req.body.uid,
|
||||||
|
"member_id": req.body.member_id,
|
||||||
|
"sessionid": req.body.sessionid,
|
||||||
|
"offer_depend_uid" : req.body.offer_depend_uid
|
||||||
|
};
|
||||||
|
logger.info(data);
|
||||||
|
let Qstring ="";
|
||||||
|
Qstring = "SELECT c.job_id,c.client_id, c.status,j.uid AS job_uid " +
|
||||||
|
" FROM members_jobs_contract c " +
|
||||||
|
" LEFT JOIN members_jobs j ON j.id =c.job_id " +
|
||||||
|
" LEFT JOIN members m ON m.id = c.client_id " +
|
||||||
|
" WHERE c.status =5 AND m.uid::TEXT = '"+ data.member_uid+"'";
|
||||||
|
logger.info(Qstring);
|
||||||
|
db.query(Qstring, function (err, result) {
|
||||||
|
try {
|
||||||
|
if (err) throw err;
|
||||||
|
let resultItem ={
|
||||||
|
"result": result.rows,
|
||||||
|
"total_record": result.rowCount
|
||||||
|
}
|
||||||
|
next(null, resultItem); // pass control to the next handler
|
||||||
|
} catch (e) {
|
||||||
|
next(e.message, null); // pass control to the next handler
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
module.exports = jobs;
|
module.exports = jobs;
|
||||||
|
|||||||
Reference in New Issue
Block a user