From 983973a30d1d8fb522cc42e3a9b38ba7873eadad Mon Sep 17 00:00:00 2001 From: "CHIEFSOFT\\ameye" Date: Thu, 7 Nov 2024 06:00:54 -0500 Subject: [PATCH] Reco family --- wrenchboard/src/shared_tool/reco_egine.cc | 26 ++++++++++++-- www-api/app/Models/ResultFormatter.php | 42 +++++++++++++++++++++++ 2 files changed, 65 insertions(+), 3 deletions(-) diff --git a/wrenchboard/src/shared_tool/reco_egine.cc b/wrenchboard/src/shared_tool/reco_egine.cc index 0da2f51a..c7d01802 100644 --- a/wrenchboard/src/shared_tool/reco_egine.cc +++ b/wrenchboard/src/shared_tool/reco_egine.cc @@ -103,8 +103,8 @@ long WrenchFamilyHomeBanners(CVars in, CVars &out){ if(itm_count < 3){ // if( RecoLearnMore( itm_count, in, out ) != PHP_API_BAD_PARAM ) { itm_count++; } -// if( RecoPlayGround( itm_count, in, out ) != PHP_API_BAD_PARAM ) { itm_count++; } - if( RecoReferAFreind( itm_count, in, out ) != PHP_API_BAD_PARAM ) { itm_count++; } + if( RecoPlayGround( itm_count, in, out ) != PHP_API_BAD_PARAM ) { itm_count++; } +// if( RecoReferAFreind( itm_count, in, out ) != PHP_API_BAD_PARAM ) { itm_count++; } // if( RecoCheckBlog( itm_count, in, out ) != PHP_API_BAD_PARAM ) { itm_count++; } } @@ -151,7 +151,10 @@ long RecoCheckFamilyOffers( int itm_count, CVars in, CVars &out ){ out[vname] ="URL"; snprintf(vname, sizeof (vname), "link_path_%05d", ic); - out[vname] = "mytask"; + out[vname] = "pending"; + + snprintf(vname, sizeof (vname), "action_%05d", ic); + out[vname] = "pending"; snprintf(vname, sizeof (vname), "button_text_%05d", ic); out[vname] = "Continue"; @@ -216,6 +219,10 @@ long RecoCheckFamilyActive( int itm_count, CVars in, CVars &out ){ snprintf(vname, sizeof (vname), "link_path_%05d", ic); out[vname] = "mytask"; //Active Task Page //"my-active-jobs"; + snprintf(vname, sizeof (vname), "action_%05d", ic); + out[vname] = "mytask"; + + snprintf(vname, sizeof (vname), "button_text_%05d", ic); out[vname] = "View Tasks"; @@ -280,6 +287,9 @@ long RecoFamilyPastDueTask( int itm_count, CVars in, CVars &out ){ snprintf(vname, sizeof (vname), "link_path_%05d", ic); out[vname] = "pastdue"; //Active Task Page //"my-active-jobs"; + snprintf(vname, sizeof (vname), "action_%05d", ic); + out[vname] = "pastdue"; + snprintf(vname, sizeof (vname), "button_text_%05d", ic); out[vname] = "View Tasks"; @@ -345,6 +355,9 @@ long RecoFamilyKidsWaiting( int itm_count, CVars in, CVars &out ){ snprintf(vname, sizeof (vname), "link_path_%05d", ic); out[vname] = "parentwaiting"; + snprintf(vname, sizeof (vname), "action_%05d", ic); + out[vname] = "parentwaiting"; + snprintf(vname, sizeof (vname), "button_text_%05d", ic); out[vname] = "Continue"; @@ -410,6 +423,10 @@ long RecoRecomendToParent( int itm_count, CVars in, CVars &out ){ snprintf(vname, sizeof (vname), "link_path_%05d", ic); out[vname] = "familymarket"; + snprintf(vname, sizeof (vname), "action_%05d", ic); + out[vname] = "familymarket"; + + snprintf(vname, sizeof (vname), "button_text_%05d", ic); out[vname] = "View"; @@ -687,6 +704,9 @@ long RecoPlayGround( int itm_count, CVars in, CVars &out ){ snprintf(vname, sizeof (vname), "link_path_%05d", ic); out[vname] = "resources"; + snprintf(vname, sizeof (vname), "action_%05d", ic); + out[vname] = "resources"; + snprintf(vname, sizeof (vname), "button_text_%05d", ic); out[vname] = "View Tasks"; diff --git a/www-api/app/Models/ResultFormatter.php b/www-api/app/Models/ResultFormatter.php index cb7a98e6..61f3725e 100644 --- a/www-api/app/Models/ResultFormatter.php +++ b/www-api/app/Models/ResultFormatter.php @@ -454,6 +454,48 @@ class ResultFormatter extends Model ); } break; + + case WRENCHBOARD_FAMILY_HOMEBANNERS: + $total = $out["total_record"]; + $res = array( + "status" => $out["status"], + "total_record" => ($total - 1), + "internal_return" => $out["internal_return"], + "family_action" => 0, + "home_dash_type" => $out["home_dash_type"], + "result_list" => array(), + ); + for ($i = 0; $i < $total; $i++) { + $key = sprintf("%05d", $i); + $banner_action = $out["action_${key}"]; + $res["result_list"][] = + [$banner_action => + ["banner" => + [ + "text" => $out["title_${key}"], + "contract" => $out["contract_${key}"], + "card_type" => $out["card_type_${key}"], + "style" => $out["card_style_${key}"], + "description" => $out["description_${key}"], + "blog_id" => $out["blog_id_${key}"], + "card_icon" => $out["card_icon_${key}"], + "offer_id" => $out["offer_id_${key}"], + "image" => $this->fixEmptyBanner( $out["banner_${key}"]), + "banner_location" => $out["banner_location_${key}"], + "link_path" => $out["link_path_${key}"], + "action" => $banner_action, + "button_text" => $out["button_text_${key}"], + "short_button_text" => $out["short_button_text_${key}"], + "short_title" => $out["short_title_${key}"], + "short_description" => $out["short_description_${key}"], + "short_style" => $out["short_style_${key}"], + "status"=> 1 + ] + ] + ]; + } + break; + case WRENCHBOARD_CONTRACT_MSGLIST: $total = $out["total_record"]; $res = array(