From d319eda408eef62d25bc63ef31b7ff5e26b6f068 Mon Sep 17 00:00:00 2001 From: "CHIEFSOFT\\ameye" Date: Sat, 28 Sep 2024 18:05:48 -0400 Subject: [PATCH] $in["nocache"] = $in["nocache"] ?? false; --- www-api/app/Controllers/WrenchBanners.php | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/www-api/app/Controllers/WrenchBanners.php b/www-api/app/Controllers/WrenchBanners.php index 06e41b27..dbac8c33 100644 --- a/www-api/app/Controllers/WrenchBanners.php +++ b/www-api/app/Controllers/WrenchBanners.php @@ -42,7 +42,10 @@ class WrenchBanners extends BaseController //activetaskslist private function bannerGetActiveTasks($in){ $in["action"] = WRENCHBOARD_JOB_USERACTIVE; - $endpoint = "BANNERS_ACTIVETASK-".str_replace("-", "_", $in["uid"]); // $in["uid"]; // str_pad($in["uid"], 12, "0", STR_PAD_LEFT); + $in["nocache"] = $in["nocache"] ?? false; + + $endpoint = "BANNERS_ACTIVETASK-".str_replace("-", "_", $in["uid"]); + if ($in["nocache"]) $this->deleteCache($endpoint); $wrenchboard = new \App\Models\BackendModel(); $out = $this->getCache($endpoint); @@ -60,9 +63,11 @@ class WrenchBanners extends BaseController } private function bannerGetOffers($in){ $in["action"] = WRENCHBOARD_MOBILE_OFFERSLIST; - $endpoint = "BANNERS_OFFERS-". str_replace("-", "_", $in["uid"]); // $in["uid"];$in["uid"]; // str_pad($in["uid"], 12, "0", STR_PAD_LEFT); + $endpoint = "BANNERS_OFFERS-". str_replace("-", "_", $in["uid"]); $wrenchboard = new \App\Models\BackendModel(); + $in["nocache"] = $in["nocache"] ?? false; + if ($in["nocache"]) $this->deleteCache($endpoint); $out = $this->getCache($endpoint); if (count($out)==0){ $in["limit"] = 10; @@ -83,7 +88,10 @@ class WrenchBanners extends BaseController $in["uid"]=$in["uuid"]; } - $endpoint = "ACCOUNT_HOMEBANNERS-".str_replace("-", "_", $in["uid"]); // $in["uid"]; $in["uid"]; // str_pad($in["uid"], 12, "0", STR_PAD_LEFT); + $in["nocache"] = $in["nocache"] ?? false; + $endpoint = "ACCOUNT_HOMEBANNERS-".str_replace("-", "_", $in["uid"]); + if ($in["nocache"]) $this->deleteCache($endpoint); + $out = $this->getCache($endpoint); // try find in cache if ( count($out) == 0 ){ $ret = $this->wrenchboard->wrenchboard_api($in, $out);