From ff4dfed01d32fffb079b376753dfcfd4d5c393a5 Mon Sep 17 00:00:00 2001 From: "CHIEFSOFT\\ameye" Date: Sun, 4 Aug 2024 13:17:23 -0400 Subject: [PATCH] banner fix --- service/banners.js | 58 +++++++++++++++------------------------------- 1 file changed, 19 insertions(+), 39 deletions(-) diff --git a/service/banners.js b/service/banners.js index ebff669..46ad300 100644 --- a/service/banners.js +++ b/service/banners.js @@ -34,16 +34,23 @@ var banners = { logger.info("client_id result.rows ==> ",result.rows); client_id = result.rows[0]["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 - var reqClinet = { - "uid": req.body.uid, - "client_id": req.body.member_id, - }; + // var reqClinet = { + // "uid": req.body.uid, + // "client_id": req.body.member_id, + // }; // this.RecoCheckActive=( reqClinet,r2,r3)=>{ // // } - +/* Qstring1 = "SELECT count(id) AS total_active_jobs FROM members_jobs_contract " + " WHERE client_id = "+client_id+" AND status =1 AND delivery_date > now() "; logger.info(Qstring1); @@ -74,7 +81,8 @@ var banners = { 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; @@ -87,6 +95,9 @@ var banners = { } next(null, resultItem ); // pass control to the next handler } + */ + + // end of we have client id @@ -113,24 +124,6 @@ var banners = { //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 = { "pending": { "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) { -var result=[]; + var result=[]; this.RecoCheckOffers(req, res, function(err, result){ logger.info("************************ aaaa");