[8] ErrorException in Index.php line 142

Trying to access array offset on value of type null

  1. $c_id = Db::name('cate')->where('pid',$mid)->order('sort asc')->value('id');
  2. if($c_id){
  3. $cid = $c_id;
  4. }
  5. }
  6. }
  7. }
  8. if(empty($cate)){
  9. $menu_data = Db::name('cate')->where('pid', 0)->where('id',$mid)->find();
  10. $cate = Db::name('cate')->where('pid', $menu_data['id'])->order('sort asc')->field('id,title,pid,sort,class,icon')->find();
  11. if(empty($cate)){
  12. header("Location:".$url);
  13. exit;
  14. }
  15. }
  16. $cate_class = $cate['class'];
  17. //[0=>'文字列表',1=>'图文列表',2=>'图册列表',3=>'图文详情',4=>'视频',5=>'外部链接']
  18. if(in_array($cate_class, [0,1,2,4,5])){
  19. if($cate_class==1||$cate_class==2){

Call Stack

  1. in Index.php line 142
  2. at Error::appError() in Index.php line 142
  3. at Index->lists()
  4. at ReflectionMethod->invokeArgs() in Container.php line 395
  5. at Container->invokeReflectMethod() in Module.php line 131
  6. at Module->think\route\dispatch\{closure}()
  7. at call_user_func_array() in Middleware.php line 185
  8. at Middleware->think\{closure}()
  9. at call_user_func() in Middleware.php line 130
  10. at Middleware->dispatch() in Module.php line 136
  11. at Module->exec() in Dispatch.php line 168
  12. at Dispatch->run() in App.php line 432
  13. at App->think\{closure}()
  14. at call_user_func_array() in Middleware.php line 185
  15. at Middleware->think\{closure}()
  16. at call_user_func() in Middleware.php line 130
  17. at Middleware->dispatch() in App.php line 435
  18. at App->run() in index.php line 27

Environment Variables

GET Data
amp;mid 3
amp;cid 27
amp;did 87
POST Dataempty
Filesempty
Cookiesempty
Sessionempty
Server/Request Data
USER www
HOME /home/www
HTTP_ACCEPT_ENCODING gzip, br, zstd, deflate
HTTP_USER_AGENT Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
HTTP_ACCEPT */*
HTTP_HOST taocharm.com
PATH_INFO
REDIRECT_STATUS 200
SERVER_NAME taocharm.com
SERVER_PORT 443
SERVER_ADDR 103.178.56.131
REMOTE_PORT 15192
REMOTE_ADDR 18.119.142.123
SERVER_SOFTWARE nginx/1.24.0
GATEWAY_INTERFACE CGI/1.1
HTTPS on
REQUEST_SCHEME https
SERVER_PROTOCOL HTTP/2.0
DOCUMENT_ROOT /www/wwwroot/taocharm.com/public
DOCUMENT_URI /index.php
REQUEST_URI /index/index/lists&mid=3&cid=27&did=87
SCRIPT_NAME /index.php
CONTENT_LENGTH
CONTENT_TYPE
REQUEST_METHOD GET
QUERY_STRING s=/index/index/lists&mid=3&cid=27&did=87
SCRIPT_FILENAME /www/wwwroot/taocharm.com/public/index.php
FCGI_ROLE RESPONDER
PHP_SELF /index.php
REQUEST_TIME_FLOAT 1747633227.4294
REQUEST_TIME 1747633227
Environment Variablesempty
ThinkPHP Constants
ADMIN_FILE admin.php
FILTER_VALIDATE_BOOL 258
HTMLPURIFIER_PREFIX /www/wwwroot/taocharm.com/vendor/ezyang/htmlpurifier/library
PUBLIC_PATH /