diff --git a/www-api/app/Controllers/WrenchBanners.php b/www-api/app/Controllers/WrenchBanners.php index 614468a7..152f862f 100644 --- a/www-api/app/Controllers/WrenchBanners.php +++ b/www-api/app/Controllers/WrenchBanners.php @@ -40,6 +40,18 @@ class WrenchBanners extends BaseController // return $this->summaryReturnData($in,$out); //json_encode( $final_out ); // } + private function bannerGetOffers($in){ + $in["action"] = WRENCHBOARD_MOBILE_OFFERSLIST; + $endpoint = "BANNERS_OFFERS-". $in["uid"]; // str_pad($in["uid"], 12, "0", STR_PAD_LEFT); + $wrenchboard = new \App\Models\BackendModel(); + + $out = $this->getCache($endpoint); + if (count($out)==0){ + $ret= $wrenchboard->wrenchboard_api($in, $out); + $this->saveCache($endpoint,$out,100); + } + return ( new \App\Models\ResultFormatter() )->processOutJson($in, $out); + } public function usersBanners(){ $raw_json = file_get_contents('php://input'); $in = json_decode($raw_json, true); @@ -57,6 +69,9 @@ class WrenchBanners extends BaseController log_message('critical', "usersBanners ********* ALL ".serialize($out) ); $this->saveCache($endpoint,$out,1500); } + + $out["offers_list"] = $this->bannerGetOffers($in); + return $this->summaryReturnData($in,$out); //json_encode( $final_out ); } public function apigate(){ diff --git a/www-api/app/Controllers/WrenchBlog.php b/www-api/app/Controllers/WrenchBlog.php index 0a14727a..e5fddc89 100644 --- a/www-api/app/Controllers/WrenchBlog.php +++ b/www-api/app/Controllers/WrenchBlog.php @@ -62,7 +62,7 @@ class WrenchBlog extends BaseController if (count($res1)==0){ $rawData = $this->apiData($blog_id); $res1= $rawData['payload']; //[0]['payload']; - $this->saveCache($endpoint,$res1); + $this->saveCache($endpoint,$res1,18000); } } else{