$id = input('id',0);
if($id > 0){
$this->data = $this->app->db->name('ys_news')->where('id',$id)->find();
// 上一篇/下一篇处理
$next = $this->app->db->name('ys_news')->where('type',1)->where('id','>',$id)->field('id,title')->order('id asc')->find();
$prev = $this->app->db->name('ys_news')->where('type',1)->where('id','<',$id)->field('id,title')->order('id desc')->find();
$this->data['next'] = $next;
$this->data['prev'] = $prev; // 上一篇
$this->app->db->name('ys_news')->where('id',$id)->inc('views')->update();
$this->title = $this->data['title'];
$tpl = "news_detail";
}else{
$this->title = '企业新闻';
$this->list = $this->app->db->name('ys_news')->where('type',1)->order('id desc')->paginate();
$tpl = "news_index";
}
$this->fetch($this->template.$tpl);
}
USER | www |
HOME | /home/www |
HTTP_USER_AGENT | claudebot |
HTTP_ACCEPT | */* |
HTTP_HOST | www.yousenjiaoyu.com |
PATH_INFO | |
REDIRECT_STATUS | 200 |
SERVER_NAME | www.yousenjiaoyu.com |
SERVER_PORT | 443 |
SERVER_ADDR | 172.24.211.10 |
REMOTE_PORT | 35844 |
REMOTE_ADDR | 54.211.148.68 |
SERVER_SOFTWARE | nginx/1.18.0 |
GATEWAY_INTERFACE | CGI/1.1 |
HTTPS | on |
REQUEST_SCHEME | https |
SERVER_PROTOCOL | HTTP/2.0 |
DOCUMENT_ROOT | /www/wwwroot/yousenjiaoyu.com/public |
DOCUMENT_URI | /index.php |
REQUEST_URI | /news/124.html |
SCRIPT_NAME | /index.php |
CONTENT_LENGTH | |
CONTENT_TYPE | |
REQUEST_METHOD | GET |
QUERY_STRING | s=/news/124.html |
SCRIPT_FILENAME | /www/wwwroot/yousenjiaoyu.com/public/index.php |
FCGI_ROLE | RESPONDER |
PHP_SELF | /index.php |
REQUEST_TIME_FLOAT | 1711710704.5968 |
REQUEST_TIME | 1711710704 |