[8] ErrorException in News.php line 35

Trying to access array offset on value of type null

  1. return $this->fetch();
  2. }
  3. public function detail($id = 0){
  4. //新闻推荐
  5. $map = [];
  6. $map['id'] = $id;//分类id
  7. $field = 'id,name,content';
  8. $info = model('News')->getNewsInfo($map,$field);
  9. $info['content'] = htmlspecialchars_decode($info['content']);
  10. $this->assign('info', $info);
  11. if($this->phoneType == 'mobile'){
  12. return $this->fetch('m_detail');
  13. }
  14. return $this->fetch();
  15. }
  16. }

Call Stack

  1. in News.php line 35
  2. at Error::appError(8, 'Trying to access arr...', '/www/spcentry/websit...', 35, ['id' => 'index', 'map' => ['id' => 'index'], 'field' => 'id,name,content', ...]) in News.php line 35
  3. at News->detail('index')
  4. at ReflectionMethod->invokeArgs(object(News), ['index']) in App.php line 197
  5. at App::invokeMethod([object(News), 'detail'], []) in App.php line 416
  6. at App::module(['index', 'news', 'detail'], ['app_host' => '', 'app_debug' => true, 'app_trace' => false, ...], true) in App.php line 296
  7. at App::exec(['type' => 'module', 'module' => ['index', 'news', 'detail']], ['app_host' => '', 'app_debug' => true, 'app_trace' => false, ...]) in App.php line 124
  8. at App::run() in start.php line 18
  9. at require('/www/spcentry/websit...') in index.php line 17

Exception Datas

Error Context
id index
map { "id": "index" }
field id,name,content
info Resource

Environment Variables

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

Server/Request Data

HOSTNAME
3000273968bd
PHP_INI_DIR
/usr/local/etc/php
SHLVL
1
HOME
/home/www-data
PHP_LDFLAGS
-Wl,-O1 -pie
PHP_CFLAGS
-fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
PHP_VERSION
7.4.27
COMPOSER_HOME
/tmp/composer
GPG_KEYS
42670A7FE4D0441C8E4632349E4FDC074A4EF02D 5A52880781F755608BF815FC910DEB46F53EA312
PHP_CPPFLAGS
-fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
PHP_ASC_URL
https://www.php.net/distributions/php-7.4.27.tar.xz.asc
PHP_URL
https://www.php.net/distributions/php-7.4.27.tar.xz
PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
LD_PRELOAD
/usr/lib/preloadable_libiconv.so php
PHPIZE_DEPS
autoconf dpkg-dev dpkg file g++ gcc libc-dev make pkgconf re2c
PWD
/www
PHP_SHA256
3f8b937310f155822752229c2c2feb8cc2621e25a728e7b94d0d74c128c43d0c
USER
www-data
HTTP_ACCEPT_ENCODING
gzip, deflate
HTTP_REFERER
http://www.spcentury.com/index/news/detail/id/1.html
HTTP_ACCEPT_LANGUAGE
zh-cn
HTTP_USER_AGENT
SiteSucker for macOS/3.0
HTTP_ACCEPT
text/html,*/*;q=0.8
HTTP_CONNECTION
keep-alive
HTTP_HOST
www.spcentury.com
REDIRECT_STATUS
200
SERVER_NAME
spcentury.com
SERVER_PORT
80
SERVER_ADDR
172.18.0.3
REMOTE_PORT
50647
REMOTE_ADDR
42.7.220.79
SERVER_SOFTWARE
nginx
GATEWAY_INTERFACE
CGI/1.1
REQUEST_SCHEME
http
SERVER_PROTOCOL
HTTP/1.1
DOCUMENT_ROOT
/www/spcentry/website/public
DOCUMENT_URI
/index.php
REQUEST_URI
/index/news/detail/id/index.html
SCRIPT_NAME
/index.php
CONTENT_LENGTH
CONTENT_TYPE
REQUEST_METHOD
GET
QUERY_STRING
s=/index/news/detail/id/index.html
SCRIPT_FILENAME
/www/spcentry/website/public/index.php
FCGI_ROLE
RESPONDER
PHP_SELF
/index.php
REQUEST_TIME_FLOAT
1704027117.4266
REQUEST_TIME
1704027117
PATH_INFO
/index/news/detail/id/index.html
Environment Variables
empty

ThinkPHP Constants

APP_PATH
/www/spcentry/website/public/../application/
THINK_VERSION
5.0.11
THINK_START_TIME
1704027117.4267
THINK_START_MEM
358200
EXT
.php
DS
/
THINK_PATH
/www/spcentry/website/thinkphp/
LIB_PATH
/www/spcentry/website/thinkphp/library/
CORE_PATH
/www/spcentry/website/thinkphp/library/think/
TRAIT_PATH
/www/spcentry/website/thinkphp/library/traits/
ROOT_PATH
/www/spcentry/website/
EXTEND_PATH
/www/spcentry/website/extend/
VENDOR_PATH
/www/spcentry/website/vendor/
RUNTIME_PATH
/www/spcentry/website/runtime/
LOG_PATH
/www/spcentry/website/runtime/log/
CACHE_PATH
/www/spcentry/website/runtime/cache/
TEMP_PATH
/www/spcentry/website/runtime/temp/
CONF_PATH
/www/spcentry/website/public/../application/
CONF_EXT
.php
ENV_PREFIX
PHP_
IS_CLI
false
IS_WIN
false