Compare commits
2 Commits
3a0c0c1458
...
286e49653e
Author | SHA1 | Date |
---|---|---|
Arnaud Fornerot | 286e49653e | |
afornerot | 000f0114c2 |
|
@ -288,9 +288,16 @@
|
|||
}
|
||||
|
||||
if($curentuser!="anon.") {
|
||||
$visitedate=clone $curentuser->getVisitedate();
|
||||
if($visitedate) $visitedate->add(new \DateInterval("PT1H"));
|
||||
$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) {
|
||||
$curentuser->setVisitedate($now);
|
||||
$curentuser->setVisitecpt($curentuser->getVisitecpt()+1);
|
||||
|
@ -300,3 +307,4 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue