protected function initialize()
{
parent::initialize();
$tid = $this->request->param('tid/d',0);
if(empty($tid)){
throw new HttpException(404, '未找到相关信息');
}
$typeinfo = Db::name('category')->where('id',$tid)->cache(config('cache.expire'))->find();
if(empty($typeinfo)){
throw new HttpException(404, '未找到相关信息');
}
if ($typeinfo['isjump']) { //跳转到下级(排序第一个)
$son = db('category')->cache(true)->where(['pid' => $typeinfo['id']])->order(['sort' => 'asc', 'id' => 'asc'])->find();
if (!empty($son)) {
return $this->redirect(getUrl('Category/article_list', ['tid' => $son['id']], true));
}
}
foreach ($typeinfo as $key => &$val){
if(in_array($key,['template_index','template_list','template_article'])){
/list/42_html |
USER | www |
HOME | /home/www |
SCRIPT_NAME | /index.php |
REQUEST_URI | /list/42.html |
QUERY_STRING | /list/42.html |
REQUEST_METHOD | GET |
SERVER_PROTOCOL | HTTP/1.1 |
GATEWAY_INTERFACE | CGI/1.1 |
REDIRECT_QUERY_STRING | /list/42.html |
REDIRECT_URL | /list/42.html |
REMOTE_PORT | 43348 |
SCRIPT_FILENAME | /www/wwwroot/www.dyolor.com/index.php |
SERVER_ADMIN | webmaster@example.com |
CONTEXT_DOCUMENT_ROOT | /www/wwwroot/www.dyolor.com |
CONTEXT_PREFIX | |
REQUEST_SCHEME | http |
DOCUMENT_ROOT | /www/wwwroot/www.dyolor.com |
REMOTE_ADDR | 44.200.65.174 |
SERVER_PORT | 80 |
SERVER_ADDR | 172.23.52.77 |
SERVER_NAME | www.dyolor.com |
SERVER_SOFTWARE | Apache |
SERVER_SIGNATURE | <address>Apache Server at www.dyolor.com Port 80</address> |
LD_LIBRARY_PATH | /www/server/apache/lib |
PATH | /www/server/panel/pyenv/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/root/bin |
HTTP_HOST | www.dyolor.com |
HTTP_REFERER | http://dcsjchina.com/list/42.html |
HTTP_USER_AGENT | claudebot |
HTTP_ACCEPT | */* |
proxy-nokeepalive | 1 |
REDIRECT_STATUS | 200 |
FCGI_ROLE | RESPONDER |
PHP_SELF | /index.php |
REQUEST_TIME_FLOAT | 1711711521.3405 |
REQUEST_TIME | 1711711521 |
APP_VERSION | 2.2.1 |
APP_NAME | EndCMS内容管理 |
UPLOAD_DIR | /www/wwwroot/www.dyolor.com/uploads/ |
APP_PATH | /www/wwwroot/www.dyolor.com/application |
DEFAULT_THUMB | /static/images/default.png |