38 lines
611 B
PHP
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());
|
|
}
|
|
|
|
}
|