From 1eccff91d9fd913b04b64fbb3dc0c763679587bf Mon Sep 17 00:00:00 2001 From: Riccardo Di Dato Date: Fri, 4 Aug 2017 12:56:29 +0200 Subject: [PATCH] =?UTF-8?q?Pi=C3=B9=20letti=20diminuito=20da=205=20a=204?= =?UTF-8?q?=20notizie?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Riccardo Di Dato --- public/index.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/index.php b/public/index.php index 0bc5487..6064552 100644 --- a/public/index.php +++ b/public/index.php @@ -84,14 +84,14 @@ try { $ristorantiNews = array_map(function($ele){$ele->testo = strip_tags($ele->testo);$ele->sottotitolo = strip_tags($ele->sottotitolo); return $ele; }, $ristorantiNews); } - $stats = GlobalVariables::get("dao")->aggregate("StatisticModel",PipelineHelper::getMostViewedOfLastDays(strtotime("-7 days"),5)); + $stats = GlobalVariables::get("dao")->aggregate("StatisticModel",PipelineHelper::getMostViewedOfLastDays(strtotime("-7 days"),4)); $idArray = array_map(function ($ele){ return new MongoId($ele["_id"]["notizia"]);}, $stats); $lastsNews = GlobalVariables::get("dao")->query("NotiziaModel", array("status"=>NotiziaModel::STATUS_ACCEPTED,"_id"=>array('$in'=>$idArray),"about.data"=>array('$lte'=>new MongoDate(),'$gte'=>new MongoDate(strtotime('-2 months')))), array("sort"=>array("about.data"=>-1)) ); - if (sizeof($lastsNews)<5){ + if (sizeof($lastsNews)<4){ $missing = 5-sizeof($lastsNews); $add = GlobalVariables::get("dao")->query("NotiziaModel", array("status"=>NotiziaModel::STATUS_ACCEPTED,"_id"=>array('$nin'=>$idArray),"about.data"=>array('$lte'=>new MongoDate())),