banner fix
This commit is contained in:
+19
-39
@@ -34,16 +34,23 @@ var banners = {
|
|||||||
logger.info("client_id result.rows ==> ",result.rows);
|
logger.info("client_id result.rows ==> ",result.rows);
|
||||||
client_id = result.rows[0]["client_id"];
|
client_id = result.rows[0]["client_id"];
|
||||||
logger.info("client_id AAA ==> ",client_id);
|
logger.info("client_id AAA ==> ",client_id);
|
||||||
|
|
||||||
|
let resultItem ={
|
||||||
|
"result": bannerArray,
|
||||||
|
"total_record": 4
|
||||||
|
}
|
||||||
|
next(null, resultItem ); // pass control to the next handler
|
||||||
|
|
||||||
// we must have client_id to contibnue
|
// we must have client_id to contibnue
|
||||||
var reqClinet = {
|
// var reqClinet = {
|
||||||
"uid": req.body.uid,
|
// "uid": req.body.uid,
|
||||||
"client_id": req.body.member_id,
|
// "client_id": req.body.member_id,
|
||||||
};
|
// };
|
||||||
|
|
||||||
// this.RecoCheckActive=( reqClinet,r2,r3)=>{
|
// this.RecoCheckActive=( reqClinet,r2,r3)=>{
|
||||||
//
|
//
|
||||||
// }
|
// }
|
||||||
|
/*
|
||||||
Qstring1 = "SELECT count(id) AS total_active_jobs FROM members_jobs_contract " +
|
Qstring1 = "SELECT count(id) AS total_active_jobs FROM members_jobs_contract " +
|
||||||
" WHERE client_id = "+client_id+" AND status =1 AND delivery_date > now() ";
|
" WHERE client_id = "+client_id+" AND status =1 AND delivery_date > now() ";
|
||||||
logger.info(Qstring1);
|
logger.info(Qstring1);
|
||||||
@@ -74,7 +81,8 @@ var banners = {
|
|||||||
logger.info("Error on past due =>", e.message);
|
logger.info("Error on past due =>", e.message);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
logger.info("total_past_client_due ==> ",total_past_client_due);
|
|
||||||
|
logger.info("total_past_client_due ==> ",total_past_client_due);
|
||||||
|
|
||||||
bannerArray.current.banner.status = 1;
|
bannerArray.current.banner.status = 1;
|
||||||
|
|
||||||
@@ -87,6 +95,9 @@ var banners = {
|
|||||||
}
|
}
|
||||||
next(null, resultItem ); // pass control to the next handler
|
next(null, resultItem ); // pass control to the next handler
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// end of we have client id
|
// end of we have client id
|
||||||
@@ -113,24 +124,6 @@ var banners = {
|
|||||||
//bannerCards.push(bannerArray.current);
|
//bannerCards.push(bannerArray.current);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// // 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
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
// });
|
|
||||||
var bannerArray = {
|
var bannerArray = {
|
||||||
"pending": {
|
"pending": {
|
||||||
"banner": {
|
"banner": {
|
||||||
@@ -188,22 +181,9 @@ var banners = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
},
|
||||||
// "another1task": {
|
|
||||||
// "banner": {
|
|
||||||
// "image": "https://www.wrenchboard.com/assets/images/apps/banners/recommend-banner.jpg",
|
|
||||||
// "icon": "bannerimage.icon",
|
|
||||||
// "style": "style4",
|
|
||||||
// "text": "Dummy for now",
|
|
||||||
// "description": "dummy dummy dummy",
|
|
||||||
// "action": "thisaction"
|
|
||||||
// }
|
|
||||||
// },
|
|
||||||
|
|
||||||
|
|
||||||
},
|
|
||||||
homebanners: function (req, res, next) {
|
homebanners: function (req, res, next) {
|
||||||
var result=[];
|
var result=[];
|
||||||
|
|
||||||
this.RecoCheckOffers(req, res, function(err, result){
|
this.RecoCheckOffers(req, res, function(err, result){
|
||||||
logger.info("************************ aaaa");
|
logger.info("************************ aaaa");
|
||||||
|
|||||||
Reference in New Issue
Block a user