[8] ErrorException in NewsController.php line 121

未定义数组索引: data

  1. $posts['data'][$key]['icon']="/upload/".$icon;
  2. $posts['data'][$key]['has_icon']=1;
  3. }
  4. }
  5. Db::name('portal_post')->where('id',$id)->update(['post_hits'=>$detail['post_hits']+1]);
  6. }
  7. $this->assign('news',$posts['data']);
  8. $this->assign('detail',$detail);
  9. $this->assign('pre_article',$pre_article);
  10. $this->assign('next_article',$next_article);
  11. return $this->fetch(':news_detail');
  12. }
  13. }

Call Stack

  1. in NewsController.php line 121
  2. at Error::appError(8, 'Undefined index: dat...', '/www/wwwroot/www.age...', 121, ['id' => 0, 'detail' => ['post_title' => '', 'create_time' => 0, 'post_source' => '', ...], 'pre_article' => ['post_title' => '', 'id' => 0], ...]) in NewsController.php line 121
  3. at NewsController->detail()
  4. at ReflectionMethod->invokeArgs(object(NewsController), []) in App.php line 343
  5. at App::invokeMethod([object(NewsController), 'detail'], []) in App.php line 613
  6. at App::module(['portal', 'news', 'detail'], ['app_host' => '', 'app_debug' => true, 'app_trace' => false, ...], true) in App.php line 456
  7. at App::exec(['type' => 'module', 'module' => ['portal', 'news', 'detail']], ['app_host' => '', 'app_debug' => true, 'app_trace' => false, ...]) in App.php line 139
  8. at App::run() in index.php line 42

Environment Variables

GET Data
empty
POST Data
empty
Files
empty
Cookies
empty
Session
empty

Server/Request Data

USER
www
HOME
/home/www
HTTP_ACCEPT_ENCODING
deflate, gzip
HTTP_ACCEPT
*/*
HTTP_HOST
www.agehao.com
HTTP_USER_AGENT
Mozilla/5.0+(compatible;+Baiduspider/2.0;++http://www.baidu.com/search/spider.html)
PATH_INFO
/portal/news/detail/id/index.html
REDIRECT_STATUS
200
SERVER_NAME
www.agehao.com
SERVER_PORT
80
SERVER_ADDR
172.17.23.244
REMOTE_PORT
20001
REMOTE_ADDR
154.210.106.148
SERVER_SOFTWARE
nginx/1.16.1
GATEWAY_INTERFACE
CGI/1.1
REQUEST_SCHEME
http
SERVER_PROTOCOL
HTTP/1.1
DOCUMENT_ROOT
/www/wwwroot/www.agehao.com/public
DOCUMENT_URI
/index.php
REQUEST_URI
/portal/news/detail/id/index.html
SCRIPT_NAME
/index.php
CONTENT_LENGTH
CONTENT_TYPE
REQUEST_METHOD
GET
QUERY_STRING
s=/portal/news/detail/id/index.html
SCRIPT_FILENAME
/www/wwwroot/www.agehao.com/public/index.php
FCGI_ROLE
RESPONDER
PHP_SELF
/index.php
REQUEST_TIME_FLOAT
1628089354.3809
REQUEST_TIME
1628089354
Environment Variables
empty

ThinkPHP Constants

APP_DEBUG
true
CMF_ROOT
/www/wwwroot/www.agehao.com/public/../
APP_PATH
/www/wwwroot/www.agehao.com/public/../app/
CMF_PATH
/www/wwwroot/www.agehao.com/public/../simplewind/cmf/
PLUGINS_PATH
/www/wwwroot/www.agehao.com/public/plugins/
EXTEND_PATH
/www/wwwroot/www.agehao.com/public/../simplewind/extend/
VENDOR_PATH
/www/wwwroot/www.agehao.com/public/../simplewind/vendor/
RUNTIME_PATH
/www/wwwroot/www.agehao.com/public/../data/runtime/
THINKCMF_VERSION
5.0.180901
THINK_VERSION
5.0.20
THINK_START_TIME
1628089354.3814
THINK_START_MEM
378312
EXT
.php
DS
/
THINK_PATH
/www/wwwroot/www.agehao.com/simplewind/thinkphp/
LIB_PATH
/www/wwwroot/www.agehao.com/simplewind/thinkphp/library/
CORE_PATH
/www/wwwroot/www.agehao.com/simplewind/thinkphp/library/think/
TRAIT_PATH
/www/wwwroot/www.agehao.com/simplewind/thinkphp/library/traits/
ROOT_PATH
/www/wwwroot/www.agehao.com/
LOG_PATH
/www/wwwroot/www.agehao.com/public/../data/runtime/log/
CACHE_PATH
/www/wwwroot/www.agehao.com/public/../data/runtime/cache/
TEMP_PATH
/www/wwwroot/www.agehao.com/public/../data/runtime/temp/
CONF_PATH
/www/wwwroot/www.agehao.com/public/../app/
CONF_EXT
.php
ENV_PREFIX
PHP_
IS_CLI
false
IS_WIN
false
HTMLPURIFIER_PREFIX
/www/wwwroot/www.agehao.com/simplewind/vendor/ezyang/htmlpurifier/library
QINIU_FUNCTIONS_VERSION
7.2.5