From 243f8807428c12696984706155b6eb45160b2b5f Mon Sep 17 00:00:00 2001 From: "CHIEFSOFT\\ameye" Date: Sat, 20 May 2023 01:10:13 -0400 Subject: [PATCH] total rec --- wrenchboard/src/shared_tool/reco_egine.cc | 39 +++++++++++++++++++++-- 1 file changed, 37 insertions(+), 2 deletions(-) diff --git a/wrenchboard/src/shared_tool/reco_egine.cc b/wrenchboard/src/shared_tool/reco_egine.cc index ff5f7ffe..c81c540b 100644 --- a/wrenchboard/src/shared_tool/reco_egine.cc +++ b/wrenchboard/src/shared_tool/reco_egine.cc @@ -59,8 +59,43 @@ return 0; // also used from accounts long WrenchHomeBanners(CVars in, CVars &out) { out["status"] = "long WrenchHomeBanners(CVars in, CVars &out)"; - WrenchReturnJobOffersList(in, out); -return 111; + CVars offV; + + WrenchReturnJobOffersList(in, offV); + long total_offers = offV["total_record"].Long(); + if( total_offers > 0){ + + for (int i = 0, n = total_offers; i < n; i++) { + + snprintf(vname, sizeof (vname), "title_%05d", i); + out[vname] = offV[vname]; + + snprintf(vname, sizeof (vname), "card_style_%05d", i); + out[vname] = offV[vname]; + + snprintf(vname, sizeof (vname), "description_%05d", i); + out[vname] = offV[vname]; + + snprintf(vname, sizeof (vname), "card_type_%05d", i); + out[vname] = "OFFERS"; + + snprintf(vname, sizeof (vname), "offer_id_%05d", i); + out[vname] = offV[vname]; + + snprintf(vname, sizeof (vname), "blog_id_%05d", i); + out[vname] = "0"; + + snprintf(vname, sizeof (vname), "card_icon_%05d", i); + out[vname] = "icon1"; + + snprintf(vname, sizeof (vname), "contract_%05d", i); + out[vname] = offV[vname];; + + } + } + +out["total_record"] = total_offers; +return 0; } long sendOffersRecommendation( CVars in, CVars &out){