builder() ->selectSum('hits', 'total_hits') ->where([ 'podcast_id' => $podcastId, 'subscription_id' => $subscriptionId, ]) ->where('`date` >= UTC_TIMESTAMP() - INTERVAL 3 month', null, false) ->get() ->getResultArray())[0]['total_hits']; cache() ->save($cacheName, $found, 600); } return $found; } }