From 4f4510e2289b6fe0615b5fef43cd5766900bd285 Mon Sep 17 00:00:00 2001 From: "CHIEFSOFT\\ameye" Date: Thu, 12 Sep 2024 00:17:14 -0400 Subject: [PATCH] acc-family --- wrenchboard/src/shared_tool/reco_egine.cc | 86 +++++++++++++++++++++-- 1 file changed, 80 insertions(+), 6 deletions(-) diff --git a/wrenchboard/src/shared_tool/reco_egine.cc b/wrenchboard/src/shared_tool/reco_egine.cc index 7a9a34c7..12c7b9e5 100644 --- a/wrenchboard/src/shared_tool/reco_egine.cc +++ b/wrenchboard/src/shared_tool/reco_egine.cc @@ -40,7 +40,7 @@ long RecoOffersInterest( int itm_count, CVars in, CVars &out ); long RecoReferAFreind(int itm_count, CVars in, CVars &out ); long RecoPendingInterestCount( int itm_count, CVars in, CVars &out ); long RecoStartMarketCard( int itm_count, CVars in, CVars &out ); - +long RecoStartMarketCardUS( int itm_count, CVars in, CVars &out ); long recommendation_engine(long action , CVars in, CVars &out) { try{ @@ -80,6 +80,7 @@ long WrenchFamilyHomeBanners(CVars in, CVars &out){ } //long RecoStartMarketCard( int itm_count, CVars in, CVars &out ); +//long RecoStartMarketCardUS( int itm_count, CVars in, CVars &out ); // also used from accounts long WrenchHomeBanners(CVars in, CVars &out) { @@ -89,6 +90,7 @@ long WrenchHomeBanners(CVars in, CVars &out) { char vname[30]; long member_id = REQ_LONG(in, "member_id", 1, -1); int itm_count= 0; + if( RecoStartMarketCardUS( itm_count, in, out ) != PHP_API_BAD_PARAM ) { itm_count++; } if( RecoStartMarketCard( itm_count, in, out ) != PHP_API_BAD_PARAM ) { itm_count++; } if( RecoCheckOffers( itm_count, in, out ) != PHP_API_BAD_PARAM ) { itm_count++; } if( RecoPendingInterestCount( itm_count, in, out ) != PHP_API_BAD_PARAM ) { itm_count++; } @@ -154,6 +156,70 @@ JOBOWNER_HOME_DASH return ret; } +long RecoStartMarketCardUS( int itm_count, CVars in, CVars &out ){ + logfmt(logINFO, "RecoCheckOffers()"); + long ret = PHP_API_BAD_PARAM; + const PGresult *res; + char vname[30]; + try { + int ic = itm_count; + long member_id = REQ_LONG(in, "member_id", 1, -1); + res = pgsql_query("SELECT * FROM members WHERE uid::text = '%s' AND added::date > now() - interval '3000 minutes' AND country='US' ", in["uuid"].c_str()); + if (res != NULL && pgsql_num_rows(res) > 0) { + + snprintf(vname, sizeof (vname), "title_%05d", ic); + out[vname] = "Find new task in the market."; + + snprintf(vname, sizeof (vname), "description_%05d", ic); + out[vname] = "You have received some offers. View, accept, or reject before the offer(s) expire."; + + snprintf(vname, sizeof (vname), "card_type_%05d", ic); + out[vname] = "OFFERS"; + + snprintf(vname, sizeof (vname), "offer_id_%05d", ic); + out[vname] = "0"; + + snprintf(vname, sizeof (vname), "blog_id_%05d", ic); + out[vname] = "0"; + + snprintf(vname, sizeof (vname), "card_icon_%05d", ic); + out[vname] = "icon1 imp_offers"; + + snprintf(vname, sizeof (vname), "banner_%05d", ic); + //out[vname] ="https://www.wrenchboard.com/assets/images/apps/banners/family-login.jpg"; + out[vname] ="https://www.wrenchboard.com/assets/images/apps/banners/dash-family.jpg"; + + snprintf(vname, sizeof (vname), "banner_location_%05d", ic); + out[vname] ="URL"; + + snprintf(vname, sizeof (vname), "link_path_%05d", ic); + out[vname] = "acc-family"; + + snprintf(vname, sizeof (vname), "button_text_%05d", ic); + out[vname] = "Continue"; + + snprintf(vname, sizeof (vname), "short_button_text_%05d", ic); + out[vname] = "View"; + + snprintf(vname, sizeof (vname), "short_title_%05d", ic); + out[vname] = "Find new task in the market."; + + snprintf(vname, sizeof (vname), "short_description_%05d", ic); + out[vname] = "Find new task in the market"; + + snprintf(vname, sizeof (vname), "short_style_%05d", ic); + out[vname] = "short_style"; + + ret = PHP_API_OK; + } + + + } catch (bad_parameter) { + out["status"] = "ERROR"; + } + logfmt(logINFO, "/RecoStartMarketCard()"); + return ret; +} long RecoOffersInterest(int itm_count, CVars in, CVars &out ){ logfmt(logINFO, "RecoOffersInterest()"); @@ -250,10 +316,17 @@ long RecoStartMarketCard( int itm_count, CVars in, CVars &out ){ out[vname] = "icon1 imp_offers"; snprintf(vname, sizeof (vname), "banner_%05d", ic); - out[vname] ="banner-waiting.jpg"; + //out[vname] ="https://www.wrenchboard.com/assets/images/apps/banners/family-login.jpg"; + out[vname] ="https://www.wrenchboard.com/assets/images/apps/banners/dash-market.jpg"; snprintf(vname, sizeof (vname), "banner_location_%05d", ic); - out[vname] ="LOCAL"; + out[vname] ="URL"; + +// snprintf(vname, sizeof (vname), "banner_%05d", ic); +// out[vname] ="banner-waiting.jpg"; +// +// snprintf(vname, sizeof (vname), "banner_location_%05d", ic); +// out[vname] ="LOCAL"; snprintf(vname, sizeof (vname), "link_path_%05d", ic); out[vname] = "mytask"; @@ -262,7 +335,7 @@ long RecoStartMarketCard( int itm_count, CVars in, CVars &out ){ out[vname] = "Continue"; snprintf(vname, sizeof (vname), "short_button_text_%05d", ic); - out[vname] = "short_button_text"; + out[vname] = "View"; snprintf(vname, sizeof (vname), "short_title_%05d", ic); out[vname] = "Find new task in the market."; @@ -480,7 +553,7 @@ long RecoReferAFreind(int itm_count, CVars in, CVars &out ){ long RecoPendingInterestCount( int itm_count, CVars in, CVars &out ){ //SELECT count(id) AS family_count FROM members_family WHERE member_id =1 AND status = 1 AND last_login IS NULL ; - logfmt(logINFO, "RecoCheckFamilyCount()"); + logfmt(logINFO, "RecoPendingInterestCount()"); long ret = PHP_API_BAD_PARAM; const PGresult *res; char vname[30]; @@ -574,7 +647,8 @@ long RecoCheckFamilyCount( int itm_count, CVars in, CVars &out ){ out[vname] = "icon1"; snprintf(vname, sizeof (vname), "banner_%05d", ic); - out[vname] ="https://blog.wrenchboard.com/wp-content/uploads/2022/01/wrechboard-sample.jpg"; + //out[vname] ="https://blog.wrenchboard.com/wp-content/uploads/2022/01/wrechboard-sample.jpg"; + out[vname] ="https://www.wrenchboard.com/assets/images/apps/banners/family-invite.jpg"; snprintf(vname, sizeof (vname), "banner_location_%05d", ic); out[vname] ="URL";