redeem wallet

This commit is contained in:
CHIEFSOFT\ameye
2024-03-09 14:37:42 -05:00
parent 69e7139d42
commit 73d6471eb2
4 changed files with 160 additions and 72 deletions
+6 -55
View File
@@ -5,7 +5,7 @@ const db = require('../app/db')
const logger = require('../app/logger');
var redeem = {
getfamilybanners: function (req, res, next) {
getredeemoptions: function (req, res, next) {
//console.log("REQ---->",req.body.uid);
var data = {
@@ -15,49 +15,7 @@ var redeem = {
"sessionid": req.body.sessionid,
"page": req.body.page
};
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 j.title,j.description,m.id AS job_id,m.expire,m.job_description,j.price, " +
" m.offer_code,j.timeline_days, to_char(m.expire, 'Dy Mon dd, yyyy HH:MI AM') AS expire2," +
" m.uid AS offer_uid,j.uid AS job_uid,m.added::date AS offer_added,j.country AS job_country, " +
" c.code AS currency_code, c.description AS currency_description,j.country, j.category " +
" FROM members_jobs_offer m " +
" LEFT JOIN members_jobs j ON j.id=m.job_id " +
" LEFT JOIN currency c ON c.country=j.country " +
" WHERE m.status = 1 AND m.client_id=0 " +
" AND m.expire IS NOT NULL " +
" AND m.public_view = 1 AND m.expire> now() AND j.status = 1 " + QextraString +
" ORDER BY m.expire DESC LIMIT "+ data.limit;
// // 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 = {
"thiskey01": {
"banner": {
@@ -130,26 +88,19 @@ var redeem = {
},
}
};
// "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"
// }
// },
let resultItem ={
"result": bannerArray,
"total_record": 4
"total_record": 7
}
next(null, resultItem ); // pass control to the next handler
},
homebanners: function (req, res, next) {
//SELECT w.amount,c.*,w.amount AS current_balance,c.country,w.transfer_limit,w.uid AS wallet_uid FROM members_wallet w LEFT JOIN currency c ON c.code=w.currency WHERE w.member_id = 1 ORDER BY c.lorder DESC
var result=[];
this.RecoCheckOffers(req, res, function(err, result){