From 4f0c5b003db791fcba7ec200ec1978de1648f125 Mon Sep 17 00:00:00 2001 From: "CHIEFSOFT\\ameye" Date: Tue, 8 Oct 2024 06:04:20 -0400 Subject: [PATCH] reward history --- www-api/app/Config/RoutesV1.php | 2 +- www-api/app/Controllers/WrenchFamily.php | 18 +++++++++++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/www-api/app/Config/RoutesV1.php b/www-api/app/Config/RoutesV1.php index 221d5d6f..1b43ec88 100644 --- a/www-api/app/Config/RoutesV1.php +++ b/www-api/app/Config/RoutesV1.php @@ -133,7 +133,7 @@ $routes->post('/en/wrench/api/v1/connectmembers', 'WrenchFamily::familyCon $routes->post('/en/wrench/api/v1/connectinvite', 'WrenchFamily::familyConnectInvite'); -$routes->post('/en/wrench/api/v1/familyrewardhx', 'WrenchApi::apigate'); +$routes->post('/en/wrench/api/v1/familyrewardhx', 'WrenchFamily::familyRewardHx'); // WrenchApi::apigate $routes->post('/en/wrench/api/v1/familytransferstart', 'WrenchApi::apigate'); $routes->post('/en/wrench/api/v1/familytransfer', 'WrenchApi::apigate'); diff --git a/www-api/app/Controllers/WrenchFamily.php b/www-api/app/Controllers/WrenchFamily.php index e7cd4c6a..c15a3ae8 100644 --- a/www-api/app/Controllers/WrenchFamily.php +++ b/www-api/app/Controllers/WrenchFamily.php @@ -144,5 +144,21 @@ class WrenchFamily extends BaseController } return $this->summaryReturnData($in,$out); //json_encode( $final_out ); } - //familysampletasks + + + public function familyRewardHx(){ + + $raw_json = file_get_contents('php://input'); + $in = json_decode($raw_json, true); + + $in["action"] = WRENCHBOARD_FAMILY_TRANSFERHX; + $endpoint = "FAMILY_REWARD_HX-". $in["uid"]; // str_pad($in["uid"], 12, "0", STR_PAD_LEFT); + $out = $this->getCache($endpoint); // try find in cache + if ( count($out) == 0 ){ + $ret = $this->wrenchboard->wrenchboard_api($in, $out); + $out['internal_return'] = $ret; + $this->saveCache($endpoint,$out,1000); + } + return $this->summaryReturnData($in,$out); //json_encode( $final_out ); + } } \ No newline at end of file