common media

This commit is contained in:
CHIEFSOFT\ameye
2024-03-25 14:57:55 -04:00
parent 171affc4df
commit fe5d2c01ac
2 changed files with 78 additions and 1 deletions
+1 -1
View File
@@ -23,7 +23,7 @@ var controllers = {
},
getCommonMedia: function(req, res) {
//homebanners
resourcecategory.homebanners(req, res, function(err, dist) {
resourcecategory.commonmedia(req, res, function(err, dist) {
if (err) {
res.send(err);
}
+77
View File
@@ -132,6 +132,83 @@ var resourcecategory = {
}
next(null, resultItem ); // pass control to the next handler
},
commonmedia: function (req, res, next) {
var result=[];
//common_media
var data = {
"uid": req.body.uid,
"member_id": req.body.member_id,
"limit": (req.body.limit != null && req.body.limit !== "") ? req.body.limit : 20,
"sessionid": req.body.sessionid,
"page": req.body.page
};
let Qstring = "SELECT * FROM common_media"; // "SELECT uid,id,username FROM members LIMIT 10";
// 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 result_list =[
{
"title": "Some family accounts are yet to log in.",
"contract": null,
"card_type": "FAMILY_NOLOGIN",
"card_style": null,
"description": "Some family members have not logged in - a little nudge might help.",
"blog_id": "0",
"card_icon": "icon1",
"offer_id": "0",
"banner": "https://www.wrenchboard.com/assets/images/apps/banners/family-login.jpg",
"banner_location": "URL",
"link_path": "acc-family",
"button_text": "Continue",
"short_button_text": "View Now",
"short_title": "Some family accounts are yet to log in",
"short_description": "Help your family member get started.",
"short_style": "short_style"
},
{
"title": "Share WrenchBoard with a friend.",
"contract": null,
"card_type": "INVITE",
"card_style": null,
"description": "Show WrenchBoard to a friend and earn free coupons. Get started.",
"blog_id": "0",
"card_icon": "icon1",
"offer_id": "0",
"banner": "banner-refer.jpg",
"banner_location": "LOCAL",
"link_path": "referral",
"button_text": "Continue",
"short_button_text": "View now",
"short_title": "Invite a Friend - get Rewards",
"short_description": "Share WrenchBoard with a friend.",
"short_style": "short_style by"
}
];
// let resultItem ={
// "result": result_list,
// "total_record": 5
// }
// next(null, resultItem ); // pass control to the next handler
},
homebanners: function (req, res, next) {
var result=[];