Loading Controllers/api/v2/referrals.php +5 −22 Original line number Diff line number Diff line Loading @@ -25,7 +25,7 @@ class referrals implements Interfaces\Api $response = []; $referrer_guid = isset($pages[0]) ? $pages[0] : Core\Session::getLoggedInUser()->guid; $limit = isset($_GET['limit']) ? $_GET['limit'] : 24; $limit = isset($_GET['limit']) ? $_GET['limit'] : 12; $offset = isset($_GET['offset']) ? $_GET['offset'] : ""; $manager = Di::_()->get('Referrals\Manager'); Loading @@ -47,23 +47,6 @@ class referrals implements Interfaces\Api $response['referrals'] = Factory::exportable(array_values($referrals->toArray())); $response['load-next'] = (string) $referrals->getPagingToken(); // $tempProspect = (object) [ // "guid" => "988145006634078224", // "verified" => true, // "username" => "oldprospector", // "name" => "oldprospector", // "icontime" => "1560987887" // ]; // $tempRef = (object) [ // 'referrer_guid' => '987892327202689039', // 'state' => 'complete', // 'register_timestamp' => "1560857128000", // 'join_timestamp' => "1560867128000", // 'prospect' => $tempProspect // ]; // array_push($response['referrals'], $tempRef); return Factory::response($response); } Loading Core/Referrals/Manager.php +10 −10 Original line number Diff line number Diff line Loading @@ -75,7 +75,7 @@ class Manager */ public function update($referral) { // Update the join timestamp // Update join_timestamp $this->repository->update($referral); // Send a notification to the referrer Loading @@ -91,7 +91,7 @@ class Manager */ public function ping($referral) { // Update the ping timestamp // Update ping_timestamp $this->repository->ping($referral); // Send a ping notification to the prospect Loading Core/Referrals/Referral.php +4 −4 Original line number Diff line number Diff line Loading @@ -65,12 +65,12 @@ class Referral public function getPingable() { // determines duration a referrer must wait before re-pinging // Duration referrer must wait before re-pinging $waitTime= 1000*60*60*24*7; // 7 days $now = time(); $now = time() * 1000; $elapsedTime = $now - $this->pingTimestamp; // referrer can't send another ping notification until a week has gone by if ($this->pingTimestamp && $elapsedTime < $waitTime ) { return false; } Loading Loading
Controllers/api/v2/referrals.php +5 −22 Original line number Diff line number Diff line Loading @@ -25,7 +25,7 @@ class referrals implements Interfaces\Api $response = []; $referrer_guid = isset($pages[0]) ? $pages[0] : Core\Session::getLoggedInUser()->guid; $limit = isset($_GET['limit']) ? $_GET['limit'] : 24; $limit = isset($_GET['limit']) ? $_GET['limit'] : 12; $offset = isset($_GET['offset']) ? $_GET['offset'] : ""; $manager = Di::_()->get('Referrals\Manager'); Loading @@ -47,23 +47,6 @@ class referrals implements Interfaces\Api $response['referrals'] = Factory::exportable(array_values($referrals->toArray())); $response['load-next'] = (string) $referrals->getPagingToken(); // $tempProspect = (object) [ // "guid" => "988145006634078224", // "verified" => true, // "username" => "oldprospector", // "name" => "oldprospector", // "icontime" => "1560987887" // ]; // $tempRef = (object) [ // 'referrer_guid' => '987892327202689039', // 'state' => 'complete', // 'register_timestamp' => "1560857128000", // 'join_timestamp' => "1560867128000", // 'prospect' => $tempProspect // ]; // array_push($response['referrals'], $tempRef); return Factory::response($response); } Loading
Core/Referrals/Manager.php +10 −10 Original line number Diff line number Diff line Loading @@ -75,7 +75,7 @@ class Manager */ public function update($referral) { // Update the join timestamp // Update join_timestamp $this->repository->update($referral); // Send a notification to the referrer Loading @@ -91,7 +91,7 @@ class Manager */ public function ping($referral) { // Update the ping timestamp // Update ping_timestamp $this->repository->ping($referral); // Send a ping notification to the prospect Loading
Core/Referrals/Referral.php +4 −4 Original line number Diff line number Diff line Loading @@ -65,12 +65,12 @@ class Referral public function getPingable() { // determines duration a referrer must wait before re-pinging // Duration referrer must wait before re-pinging $waitTime= 1000*60*60*24*7; // 7 days $now = time(); $now = time() * 1000; $elapsedTime = $now - $this->pingTimestamp; // referrer can't send another ping notification until a week has gone by if ($this->pingTimestamp && $elapsedTime < $waitTime ) { return false; } Loading