[8] ErrorException in Index.php line 117

Trying to access array offset on value of type null

  1. foreach($right as $key=>$value){
  2. $right[$key]['list'] = Db::name('cms_archives')->where('deletetime is null')->where($condition)->where('channel_id', $value['id'])->limit(6)->order($order)->select();
  3. }
  4. //右
  5. $this->assign('right', $right);
  6. $id = input('id');
  7. if(empty(input('type'))){
  8. $res = Db::name('cms_archives')->alias('a')->join('cms_addonnews b', 'a.id = b.id', 'LEFT')->where('a.id', $id)->find();
  9. $nav = Db::name('cms_channel')->where('id', $res['channel_id'])->find();
  10. }else{
  11. $res = Db::name('cms_page')->where('id', $id)->find();
  12. $res['publishtime'] = $res['updatetime'];
  13. $nav = [
  14. 'name' => $res['title'],
  15. 'id' => ''
  16. ];
  17. }

Call Stack

  1. in Index.php line 117
  2. at Error::appError() in Index.php line 117
  3. at Index->view()
  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/www.sjh...') in index.php line 23

Environment Variables

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

Server/Request Data

USER
www
HOME
/home/www
HTTP_USER_AGENT
claudebot
HTTP_ACCEPT
*/*
HTTP_HOST
sjhrws.com
PATH_INFO
/index/index/view/id/6.html
REDIRECT_STATUS
200
SERVER_NAME
www.sjhrws.com
SERVER_PORT
443
SERVER_ADDR
192.168.0.125
REMOTE_PORT
37062
REMOTE_ADDR
3.88.16.192
SERVER_SOFTWARE
nginx/1.21.4
GATEWAY_INTERFACE
CGI/1.1
HTTPS
on
REQUEST_SCHEME
https
SERVER_PROTOCOL
HTTP/2.0
DOCUMENT_ROOT
/www/wwwroot/www.sjhrws.com/public
DOCUMENT_URI
/index.php
REQUEST_URI
/index/index/view/id/6.html
SCRIPT_NAME
/index.php
CONTENT_LENGTH
CONTENT_TYPE
REQUEST_METHOD
GET
QUERY_STRING
s=/index/index/view/id/6.html
SCRIPT_FILENAME
/www/wwwroot/www.sjhrws.com/public/index.php
FCGI_ROLE
RESPONDER
PHP_SELF
/index.php
REQUEST_TIME_FLOAT
1711670713.9831
REQUEST_TIME
1711670713
Environment Variables
empty

ThinkPHP Constants

APP_PATH
/www/wwwroot/www.sjhrws.com/public/../application/
THINK_VERSION
5.0.24
THINK_START_TIME
1711670713.9837
THINK_START_MEM
409032
EXT
.php
DS
/
THINK_PATH
/www/wwwroot/www.sjhrws.com/thinkphp/
LIB_PATH
/www/wwwroot/www.sjhrws.com/thinkphp/library/
CORE_PATH
/www/wwwroot/www.sjhrws.com/thinkphp/library/think/
TRAIT_PATH
/www/wwwroot/www.sjhrws.com/thinkphp/library/traits/
ROOT_PATH
/www/wwwroot/www.sjhrws.com/
EXTEND_PATH
/www/wwwroot/www.sjhrws.com/extend/
VENDOR_PATH
/www/wwwroot/www.sjhrws.com/vendor/
RUNTIME_PATH
/www/wwwroot/www.sjhrws.com/runtime/
LOG_PATH
/www/wwwroot/www.sjhrws.com/runtime/log/
CACHE_PATH
/www/wwwroot/www.sjhrws.com/runtime/cache/
TEMP_PATH
/www/wwwroot/www.sjhrws.com/runtime/temp/
CONF_PATH
/www/wwwroot/www.sjhrws.com/public/../application/
CONF_EXT
.php
ENV_PREFIX
PHP_
IS_CLI
false
IS_WIN
false
FILTER_VALIDATE_BOOL
258
ADDON_PATH
/www/wwwroot/www.sjhrws.com/addons/