game2005api/webapp/controller/BaseController.class.php
2021-01-04 13:39:40 +08:00

38 lines
611 B
PHP

<?php
require 'phpcommon/sqlhelper.php';
class BaseController {
private $nowtime = 0;
function __construct()
{
$this->nowtime = phpcommon\getNowTime();
}
public function handlePre()
{
}
public function handlePost()
{
}
protected function getNowTime()
{
return $this->nowtime;
}
protected function getNowDaySeconds()
{
return phpcommon\getDaySeconds($this->nowtime);
}
protected function getTodayRemainSeconds()
{
return max(0, $this->getNowDaySeconds() + 3600 * 24 - $this->getNowTime());
}
}