Jobs promo
This commit is contained in:
@@ -11,6 +11,11 @@ var controllers = {
|
||||
res.status(200).json({'status': 'OK', 'internal_return': 0, 'result_list': result.result,'total_record': result.total_record })
|
||||
});
|
||||
},
|
||||
getPromoJobs: function(req, res) {
|
||||
jobs.getpromojobs(req, res, function(err, result) {
|
||||
res.status(200).json({'status': 'OK', 'internal_return': 0, 'result_list': result.result,'total_record': result.total_record })
|
||||
});
|
||||
},
|
||||
getMarketJobsFiles: function(req, res) {
|
||||
jobs.getmarketjobsFiles(req, res, function(err, result) {
|
||||
res.status(200).json({'status': 'OK', 'internal_return': 0, 'result_list': result.result,'total_record': result.total_record })
|
||||
|
||||
@@ -5,6 +5,8 @@ const controller = require('./controller');
|
||||
module.exports = function(app) {
|
||||
app.route('/marketjobs')
|
||||
.get(controller.getMarketJobs);
|
||||
app.route('/promojobs')
|
||||
.get(controller.getPromoJobs);
|
||||
app.route('/marketjobsfiles')
|
||||
.get(controller.getMarketJobsFiles);
|
||||
app.route('/marketjob3s/:id')
|
||||
|
||||
@@ -55,6 +55,42 @@ var jobs = {
|
||||
}
|
||||
});
|
||||
},
|
||||
getpromojobs: function (req, res, next) {
|
||||
|
||||
//console.log("REQ---->",req.body.uid);
|
||||
logger.info("------lll---->");
|
||||
logger.info(req.query);
|
||||
var data = {
|
||||
"promo": req.query.promo,
|
||||
"promo_owner": req.query.promo_owner
|
||||
};
|
||||
let Qstring =""; // "SELECT uid,id,username FROM members LIMIT 10";
|
||||
let QextraString ="";
|
||||
// if ( req.body.uid != null && req.body.uid !== ""){
|
||||
// QextraString= " AND j.country IN (SELECT c.country FROM members_wallet w " +
|
||||
// " LEFT JOIN currency c ON c.code =w.currency " +
|
||||
// " LEFT JOIN members m ON m.id = w.member_id " +
|
||||
// " WHERE m.uid = '"+req.body.uid+"' )";
|
||||
// }
|
||||
|
||||
Qstring = "SELECT uid AS job_uid, * FROM members_jobs WHERE member_id = 474 ORDER BY id DESC";
|
||||
|
||||
// logger.info(Qstring);
|
||||
db.query(Qstring, function (err, result) {
|
||||
try {
|
||||
if (err) throw err;
|
||||
let resultItem ={
|
||||
"result": result.rows,
|
||||
"total_record": result.rowCount
|
||||
}
|
||||
// logger.info(result);
|
||||
next(null, resultItem); // pass control to the next handler
|
||||
// next(null, result.rows); // pass control to the next handler
|
||||
} catch (e) {
|
||||
next(e.message, null); // pass control to the next handler
|
||||
}
|
||||
});
|
||||
},
|
||||
getmarketInterestCount: function (req, res, next) {
|
||||
logger.info("------ ********** getmarketInterestCount() ********** ---->");
|
||||
//logger.info(req.query);
|
||||
|
||||
Reference in New Issue
Block a user