From e6743f441d5404434edd58002f73ce3c898c27e7 Mon Sep 17 00:00:00 2001 From: "CHIEFSOFT\\ameye" Date: Tue, 4 Jul 2023 19:44:42 -0400 Subject: [PATCH] banner add --- wrenchboard/src/shared_tool/family_acc.cc | 9 +++++++++ www-api/app/Controllers/WrenchApi.php | 9 +++++++-- www-api/app/Models/ResultFormatter.php | 1 + 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/wrenchboard/src/shared_tool/family_acc.cc b/wrenchboard/src/shared_tool/family_acc.cc index c5315bdc..6d51ae3b 100644 --- a/wrenchboard/src/shared_tool/family_acc.cc +++ b/wrenchboard/src/shared_tool/family_acc.cc @@ -120,6 +120,8 @@ long WrenchSuggestWaitingList(CVars in, CVars &out){ // this is the parent now snprintf(vname, sizeof (vname), "status_%05d", i); out[vname] = rec["status"]; + snprintf(vname, sizeof (vname), "banner_%05d", i); + out[vname] = rec["banner"]; } } ret = PHP_API_OK; @@ -174,6 +176,9 @@ long WrenchSuggestList(CVars in, CVars &out){ snprintf(vname, sizeof (vname), "status_%05d", i); out[vname] = rec["status"]; + snprintf(vname, sizeof (vname), "banner_%05d", i); + out[vname] = rec["banner"]; + } } ret = PHP_API_OK; @@ -218,6 +223,10 @@ long WrenchSuggestTasks(CVars in, CVars &out){ xx["description"].set_valid(true); xx["family_uid"] = rec["family_uid"]; xx["family_uid"].set_valid(true); + + xx["banner"] = rec["banner"]; + xx["banner"].set_valid(true); + out["suggested_task_id"] = insert_db_record(DBS_VALID, "members_family_suggesttask", "members_family_suggesttask_id_seq", xx); ret = PHP_API_OK; out["status"] = "OK"; diff --git a/www-api/app/Controllers/WrenchApi.php b/www-api/app/Controllers/WrenchApi.php index 72d9b8c5..a2ab6feb 100644 --- a/www-api/app/Controllers/WrenchApi.php +++ b/www-api/app/Controllers/WrenchApi.php @@ -185,6 +185,9 @@ class WrenchApi extends BaseController $in["action"] = WRENCHBOARD_FAMILY_SAMPLETASKS; break; case 'familysuggesttasks': + if (!isset($in["banner"])){ + $in["banner"] = 'default.jpg'; + } $in["action"] = WRENCHBOARD_FAMILY_SGGESTTASKS; break; case 'familywaitingtasks': @@ -596,8 +599,10 @@ class WrenchApi extends BaseController switch ($in["action"]) { case WRENCHBOARD_ACCOUNT_LOGIN: case WRENCHBOARD_ACCOUNT_AUXLOGIN: - $endpoint = "SESSION-".$out["session"]; - $this->saveCache($endpoint,$out); + if (isset($out["uid"]) && $out["uid"]!=''){ + $endpoint = "SESSION-".$out["uid"]; + $this->saveCache($endpoint,$out); + } break; } // $endpoint = "WRENCH_BLOG_DATA"; diff --git a/www-api/app/Models/ResultFormatter.php b/www-api/app/Models/ResultFormatter.php index f6a98086..31519f8c 100644 --- a/www-api/app/Models/ResultFormatter.php +++ b/www-api/app/Models/ResultFormatter.php @@ -100,6 +100,7 @@ class ResultFormatter extends Model "title" => $out["title_${key}"], "added" => $out["added_${key}"], "status" => $out["status_${key}"], + "banner" => $out["banner_${key}"], ); } break;