From 36f9ab520e502f425637a497e22f1de753813951 Mon Sep 17 00:00:00 2001 From: "CHIEFSOFT\\ameye" Date: Tue, 6 Jun 2023 11:18:28 -0400 Subject: [PATCH] home banners --- wrenchboard/src/shared_tool/reco_egine.cc | 65 +++++++++++++++++++++-- www-api/app/Models/ResultFormatter.php | 1 + www-api/public/svs/user/formarter.php | 1 + 3 files changed, 63 insertions(+), 4 deletions(-) diff --git a/wrenchboard/src/shared_tool/reco_egine.cc b/wrenchboard/src/shared_tool/reco_egine.cc index 3b395d3e..f9e4e33e 100644 --- a/wrenchboard/src/shared_tool/reco_egine.cc +++ b/wrenchboard/src/shared_tool/reco_egine.cc @@ -76,7 +76,7 @@ long WrenchHomeBanners(CVars in, CVars &out) { if( RecoCheckFamilyLogin( itm_count, in, out ) != PHP_API_BAD_PARAM ) { itm_count++; } if( RecoCheckFamilyCount( itm_count, in, out ) != PHP_API_BAD_PARAM ) { itm_count++; } if( RecoCheckCoupons( itm_count, in, out ) != PHP_API_BAD_PARAM ) { itm_count++; } - //if( RecoCheckTaskDue( itm_count, in, out ) != PHP_API_BAD_PARAM ) { itm_count++; } + if( RecoCheckTaskDue( itm_count, in, out ) != PHP_API_BAD_PARAM ) { itm_count++; } if( RecoCheckBlog( itm_count, in, out ) != PHP_API_BAD_PARAM ) { itm_count++; } // WrenchReturnJobOffersList(in, offV); @@ -149,6 +149,9 @@ long RecoCheckOffers(int itm_count, CVars in, CVars &out ){ snprintf(vname, sizeof (vname), "banner_%05d", ic); out[vname] ="https://blog.wrenchboard.com/wp-content/uploads/2022/01/wrechboard-sample.jpg"; + snprintf(vname, sizeof (vname), "banner_location_%05d", ic); + out[vname] ="URL"; + snprintf(vname, sizeof (vname), "link_path_%05d", ic); out[vname] = "mytask"; @@ -196,6 +199,9 @@ long RecoCheckFamilyLogin(int itm_count, CVars in, CVars &out ){ snprintf(vname, sizeof (vname), "banner_%05d", ic); out[vname] ="https://blog.wrenchboard.com/wp-content/uploads/2022/01/wrechboard-sample.jpg"; + snprintf(vname, sizeof (vname), "banner_location_%05d", ic); + out[vname] ="URL"; + snprintf(vname, sizeof (vname), "link_path_%05d", ic); out[vname] = "acc-family"; @@ -241,6 +247,9 @@ long RecoCheckFamilyCount( int itm_count, CVars in, CVars &out ){ snprintf(vname, sizeof (vname), "banner_%05d", ic); out[vname] ="https://blog.wrenchboard.com/wp-content/uploads/2022/01/wrechboard-sample.jpg"; + snprintf(vname, sizeof (vname), "banner_location_%05d", ic); + out[vname] ="URL"; + snprintf(vname, sizeof (vname), "link_path_%05d", ic); out[vname] = "acc-family"; @@ -284,7 +293,10 @@ long RecoCheckCoupons( 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] ="banner-coupons.jpg"; + + snprintf(vname, sizeof (vname), "banner_location_%05d", ic); + out[vname] ="LOCAL"; snprintf(vname, sizeof (vname), "link_path_%05d", ic); out[vname] = "my-coupon"; @@ -299,8 +311,50 @@ long RecoCheckCoupons( int itm_count, CVars in, CVars &out ){ } long RecoCheckTaskDue( int itm_count, CVars in, CVars &out ){ - long ret = PHP_API_BAD_PARAM; - return ret; + logfmt(logINFO, "RecoCheckTaskDue()"); + 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_jobs_contract WHERE member_id = %lu AND status =1 AND delivery_date > now() ",member_id); + if (res != NULL && pgsql_num_rows(res) > 0) { + + snprintf(vname, sizeof (vname), "title_%05d", ic); + out[vname] = "Some of your task as owner of the tasks are due "; + + snprintf(vname, sizeof (vname), "description_%05d", ic); + out[vname] = "Some of your task as owner of the tasks are due, Some of your task as owner of the tasks are due"; + + snprintf(vname, sizeof (vname), "card_type_%05d", ic); + out[vname] = "PASTDUEJOB"; + + 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"; + + snprintf(vname, sizeof (vname), "banner_%05d", ic); + out[vname] ="banner-job-due.jpg"; + + snprintf(vname, sizeof (vname), "banner_location_%05d", ic); + out[vname] ="LOCAL"; + + snprintf(vname, sizeof (vname), "link_path_%05d", ic); + out[vname] = "my-pastdue-jobs"; + + ret = PHP_API_OK; + } + } catch (bad_parameter) { + out["status"] = "ERROR"; + } + logfmt(logINFO, "/RecoCheckTaskDue()"); +return ret; } long RecoCheckBlog( int itm_count, CVars in, CVars &out ){ @@ -333,6 +387,9 @@ long RecoCheckBlog( int itm_count, CVars in, CVars &out ){ snprintf(vname, sizeof (vname), "banner_%05d", ic); out[vname] ="https://blog.wrenchboard.com/wp-content/uploads/2022/01/wrechboard-sample.jpg"; + snprintf(vname, sizeof (vname), "banner_location_%05d", ic); + out[vname] ="URL"; + snprintf(vname, sizeof (vname), "link_path_%05d", ic); out[vname] = "blog-page"; diff --git a/www-api/app/Models/ResultFormatter.php b/www-api/app/Models/ResultFormatter.php index c95d55da..72138e13 100644 --- a/www-api/app/Models/ResultFormatter.php +++ b/www-api/app/Models/ResultFormatter.php @@ -112,6 +112,7 @@ class ResultFormatter extends Model "card_icon" => $out["card_icon_${key}"], "offer_id" => $out["offer_id_${key}"], "banner" => $out["banner_${key}"], + "banner_location" => $out["banner_location_${key}"], "link_path" => $out["link_path_${key}"], ); } diff --git a/www-api/public/svs/user/formarter.php b/www-api/public/svs/user/formarter.php index b4b8f84d..3d99293b 100755 --- a/www-api/public/svs/user/formarter.php +++ b/www-api/public/svs/user/formarter.php @@ -106,6 +106,7 @@ function processOutJson($in, $out) { "card_icon" => $out["card_icon_${key}"], "offer_id" => $out["offer_id_${key}"], "banner" => $out["banner_${key}"], + "banner_location" => $out["banner_location_${key}"], "link_path" => $out["link_path_${key}"], ); }