From 8cfb11fa95e2ed7f5875a9d65c858d7b7d9be52b Mon Sep 17 00:00:00 2001 From: "CHIEFSOFT\\ameye" Date: Sat, 30 Nov 2024 12:49:28 -0500 Subject: [PATCH] cache added --- www-api/app/Controllers/WrenchAccount.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/www-api/app/Controllers/WrenchAccount.php b/www-api/app/Controllers/WrenchAccount.php index 2b1bd45b..5bf007f7 100644 --- a/www-api/app/Controllers/WrenchAccount.php +++ b/www-api/app/Controllers/WrenchAccount.php @@ -58,8 +58,14 @@ class WrenchAccount extends BaseController $in["refer_link"] = str_replace('REFPROMO-', "", $in["refer_link"]); $in["action_path"] = 200; } - $ret = $this->wrenchboard->wrenchboard_api($in, $out); - $out['internal_return'] = $ret; + + $endpoint = "REFER_LINK-". $in["action_path"]."-". str_replace('-','_', $in["refer_link"]);// $in[""]; + $out = $this->getCache($endpoint); + if ( count($out)==0 ){ + $ret = $this->wrenchboard->wrenchboard_api($in, $out); + $out['internal_return'] = $ret; + $this->saveCache($endpoint,$out,360); + } return $this->respond( $this->summaryReturnData($in,$out), 200); } } \ No newline at end of file