#0 [2]ErrorException in News.php line 92

Trying to access array offset on value of type null

  1. ->where('id', $id)->inc('num_read')->update();
  2. $this->info = $this->app->db->table('data_news_item')
  3. ->where('id', $id)
  4. ->where('deleted', 0)
  5. ->where('status', 1)
  6. ->find();
  7. // $this->info['content'] = htmlentities( $this->info['content']);
  8. $this->menu = $this->app->db->table('data_news_marks')->where('id',$this->info['mark'])->find();
  9. // dump($this->menu);die;
  10. $this->title = $this->menu['name'] ?? '媒体聚焦';
  11. if ($this->info['mark'] == 20) {
  12. $this->keys = 1;
  13. } else {
  14. $this->keys = 2;
  15. }

Call Stack

  1. in News.php line 92
  2. at Error->appError() in News.php line 92
  3. at News->detail()
  4. at ReflectionMethod->invokeArgs() in Container.php line 344
  5. at Container->invokeReflectMethod() in Controller.php line 110
  6. at Controller->think\route\dispatch\{closure}() in Pipeline.php line 59
  7. at Pipeline->think\{closure}() in Pipeline.php line 66
  8. at Pipeline->then() in Controller.php line 113
  9. at Controller->exec() in Dispatch.php line 90
  10. at Dispatch->run() in Route.php line 772
  11. at Route->think\{closure}() in Pipeline.php line 59
  12. at Pipeline->think\{closure}() in Library.php line 139
  13. at Library->think\admin\{closure}()
  14. at call_user_func() in Middleware.php line 142
  15. at Middleware->think\{closure}() in Pipeline.php line 85
  16. at Pipeline->think\{closure}() in Pipeline.php line 66
  17. at Pipeline->then() in Route.php line 773
  18. at Route->dispatch() in Http.php line 216
  19. at Http->dispatchToRoute() in Http.php line 206
  20. at Http->think\{closure}() in Pipeline.php line 59
  21. at Pipeline->think\{closure}() in Multiple.php line 72
  22. at Multiple->think\admin\multiple\{closure}() in Pipeline.php line 59
  23. at Pipeline->think\{closure}() in Pipeline.php line 66
  24. at Pipeline->then() in Multiple.php line 73
  25. at Multiple->handle()
  26. at call_user_func() in Middleware.php line 142
  27. at Middleware->think\{closure}() in Pipeline.php line 85
  28. at Pipeline->think\{closure}() in LoadLangPack.php line 57
  29. at LoadLangPack->handle()
  30. at call_user_func() in Middleware.php line 142
  31. at Middleware->think\{closure}() in Pipeline.php line 85
  32. at Pipeline->think\{closure}() in SessionInit.php line 67
  33. at SessionInit->handle()
  34. at call_user_func() in Middleware.php line 142
  35. at Middleware->think\{closure}() in Pipeline.php line 85
  36. at Pipeline->think\{closure}() in Pipeline.php line 66
  37. at Pipeline->then() in Http.php line 207
  38. at Http->runWithRequest() in Http.php line 170
  39. at Http->run() in SystemService.php line 484
  40. at SystemService->doInit() in index.php line 28

Environment Variables

GET Data
id 198
POST Dataempty
Filesempty
Cookies
ssid d0279b8f8544db70b03e0624aa4b97a7
lang zh-cn
Sessionempty
Server/Request Data
USER nginx
HOME /var/lib/nginx
HTTP_COOKIE ssid=d0279b8f8544db70b03e0624aa4b97a7; lang=zh-cn
HTTP_ACCEPT_ENCODING gzip
HTTP_ACCEPT */*
HTTP_HOST www.sdbh.net
HTTP_USER_AGENT Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
PATH_INFO
SCRIPT_FILENAME /www/bohua/public/index.php
REDIRECT_STATUS 200
SERVER_NAME www.sdbh.net
SERVER_PORT 80
SERVER_ADDR 172.31.139.84
REMOTE_PORT 33800
REMOTE_ADDR 23.90.23.202
SERVER_SOFTWARE nginx/1.20.1
GATEWAY_INTERFACE CGI/1.1
REQUEST_SCHEME http
SERVER_PROTOCOL HTTP/1.1
DOCUMENT_ROOT /www/bohua/public
DOCUMENT_URI /index.php
REQUEST_URI /index/news/detail.html?id=198
SCRIPT_NAME /index.php
CONTENT_LENGTH
CONTENT_TYPE
REQUEST_METHOD GET
QUERY_STRING s=index/news/detail.html&id=198
FCGI_ROLE RESPONDER
PHP_SELF /index.php
REQUEST_TIME_FLOAT 1782311115.8847
REQUEST_TIME 1782311115
XML 地图