[8] ErrorException in News.php line 39

Trying to access array offset on value of type null

  1. 'count'=>$count,'page'=>$page,
  2. ]);
  3. return $this->view->fetch();
  4. }
  5. public function show($id = NULL)
  6. {
  7. $seo = Db::name('category')->where('id',18)->find();
  8. $show = Db::name('znews')->where('id',$id)->find();
  9. $next = Db::name('znews')->order('time desc')->where('status',$show['status'])->where('time','<',$show['time'])->find();
  10. $prev = Db::name('znews')->order('time asc')->where('status',$show['status'])->where('time','>',$show['time'])->find();
  11. $recommend = Db::name('znews')->limit(2)->order('time desc')->where('data',2)->where('id','neq',$id)->select();
  12. if(empty($id) || empty($show)){
  13. $this->redirect('/News');
  14. }
  15. $this->assign([
  16. 'seo'=>$seo,
  17. 'show'=>$show,'recommend'=>$recommend,
  18. 'prev'=>$prev,'next'=>$next,

Call Stack

  1. in News.php line 39
  2. at Error::appError() in News.php line 39
  3. at News->show()
  4. at ReflectionMethod->invokeArgs() in App.php line 343
  5. at App::invokeMethod() in App.php line 611
  6. at App::module() in App.php line 456
  7. at App::exec() in App.php line 139
  8. at App::run() in start.php line 19
  9. at require('/www/wwwroot/hongbo....') in index.php line 23

Environment Variables

GET Data

id
4
POST Data
empty
Files
empty
Cookies
empty
Session
empty

Server/Request Data

USER
www
HOME
/home/www
HTTP_ACCEPT_ENCODING
gzip
HTTP_ACCEPT
*/*
HTTP_HOST
prssh.com
HTTP_USER_AGENT
CCBot/2.0 (https://commoncrawl.org/faq/)
PATH_INFO
/News/show
REDIRECT_STATUS
200
SERVER_NAME
hongbo.ocean-site.cn
SERVER_PORT
80
SERVER_ADDR
172.19.73.149
REMOTE_PORT
36754
REMOTE_ADDR
50.2.188.226
SERVER_SOFTWARE
nginx/1.20.1
GATEWAY_INTERFACE
CGI/1.1
REQUEST_SCHEME
http
SERVER_PROTOCOL
HTTP/1.1
DOCUMENT_ROOT
/www/wwwroot/hongbo.ocean-site.cn/public
DOCUMENT_URI
/index.php
REQUEST_URI
//News/show?id=4
SCRIPT_NAME
/index.php
CONTENT_LENGTH
CONTENT_TYPE
REQUEST_METHOD
GET
QUERY_STRING
s=/News/show&id=4
SCRIPT_FILENAME
/www/wwwroot/hongbo.ocean-site.cn/public/index.php
FCGI_ROLE
RESPONDER
PHP_SELF
/index.php
REQUEST_TIME_FLOAT
1721564421.6279
REQUEST_TIME
1721564421
Environment Variables
empty

ThinkPHP Constants

APP_PATH
/www/wwwroot/hongbo.ocean-site.cn/public/../application/
THINK_VERSION
5.0.24
THINK_START_TIME
1721564421.6285
THINK_START_MEM
409096
EXT
.php
DS
/
THINK_PATH
/www/wwwroot/hongbo.ocean-site.cn/thinkphp/
LIB_PATH
/www/wwwroot/hongbo.ocean-site.cn/thinkphp/library/
CORE_PATH
/www/wwwroot/hongbo.ocean-site.cn/thinkphp/library/think/
TRAIT_PATH
/www/wwwroot/hongbo.ocean-site.cn/thinkphp/library/traits/
ROOT_PATH
/www/wwwroot/hongbo.ocean-site.cn/
EXTEND_PATH
/www/wwwroot/hongbo.ocean-site.cn/extend/
VENDOR_PATH
/www/wwwroot/hongbo.ocean-site.cn/vendor/
RUNTIME_PATH
/www/wwwroot/hongbo.ocean-site.cn/runtime/
LOG_PATH
/www/wwwroot/hongbo.ocean-site.cn/runtime/log/
CACHE_PATH
/www/wwwroot/hongbo.ocean-site.cn/runtime/cache/
TEMP_PATH
/www/wwwroot/hongbo.ocean-site.cn/runtime/temp/
CONF_PATH
/www/wwwroot/hongbo.ocean-site.cn/public/../application/
CONF_EXT
.php
ENV_PREFIX
PHP_
IS_CLI
false
IS_WIN
false
FILTER_VALIDATE_BOOL
258
ADDON_PATH
/www/wwwroot/hongbo.ocean-site.cn/addons/
XML 地图