Più letti diminuito da 5 a 4 notizie
Signed-off-by: Riccardo Di Dato <r.didato@asdynamics.it>
This commit is contained in:
+2
-2
@@ -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())),
|
||||
|
||||
Reference in New Issue
Block a user