Compare commits

...

2 Commits

Author SHA1 Message Date
Arnaud Fornerot 286e49653e Merge branch 'master' into dist/envole/6/master 2020-06-18 11:59:09 +02:00
afornerot 000f0114c2 init datevisite 2020-06-18 11:55:37 +02:00
1 changed files with 11 additions and 3 deletions

View File

@ -288,9 +288,16 @@
} }
if($curentuser!="anon.") { if($curentuser!="anon.") {
$visitedate=clone $curentuser->getVisitedate();
if($visitedate) $visitedate->add(new \DateInterval("PT1H"));
$now=new \DateTime(); $now=new \DateTime();
if(!$curentuser->getVisitedate()) {
$curentuser->setVisitedate($now);
$curentuser->setVisitecpt($curentuser->getVisitecpt()+1);
$this->em->persist($curentuser);
$this->em->flush();
}
else {
$visitedate=clone $curentuser->getVisitedate();
$visitedate->add(new \DateInterval("PT1H"));
if($visitedate<$now) { if($visitedate<$now) {
$curentuser->setVisitedate($now); $curentuser->setVisitedate($now);
$curentuser->setVisitecpt($curentuser->getVisitecpt()+1); $curentuser->setVisitecpt($curentuser->getVisitecpt()+1);
@ -300,3 +307,4 @@
} }
} }
} }
}