31 lines
966 B
PHP
31 lines
966 B
PHP
<?php
|
|
|
|
use phpcommon\SqlHelper;
|
|
class AnncController extends BaseController {
|
|
|
|
public function getAnnc()
|
|
{
|
|
// myself()->_rspData(require('../config/annc.php'));
|
|
$seconds = myself()->_getNowTime() - myself()->_getNowDaySeconds();
|
|
$data = array();
|
|
$row = myself()->_getConfDbMysql()->execQueryOne(
|
|
'SELECT * FROM t_game_annc WHERE :begin_date >= begin_date AND :end_date <= end_date AND is_open = 1 AND begin_time >= :seconds AND end_time <= :seconds',
|
|
array(
|
|
':begin_date' => myself()->_getNowTime(),
|
|
':end_date' => myself()->_getNowTime(),
|
|
':seconds' => $seconds,
|
|
)
|
|
);
|
|
error_log($seconds);
|
|
if ($row){
|
|
$data = array(
|
|
'id' => $row['uniid'],
|
|
'title' => $row['title'],
|
|
'content' => $row['content']
|
|
);
|
|
}
|
|
myself()->_rspData($data);
|
|
}
|
|
|
|
}
|