#0 [8]ErrorException in Index.php line 41

Trying to access array offset on value of type null

  1. 'syjq' => $syjq
  2. ]);
  3. }
  4. //列表页
  5. public function lists($id)
  6. {
  7. $data = Category::with('category')->find($id);
  8. //读取列表
  9. $model = $this->get_model($data['model']);
  10. //板材
  11. $bc_lists = [];
  12. if($data['model'] == '52'){
  13. $onebancai = Category::where('pid', $id)->order('sort_order desc')->column('id');
  14. foreach ($onebancai as $k=>$v){
  15. $bc_lists[$k]['head'] = Category::where('id', $v)->field('name,sname,keywords,image,icon')->find()->toArray();
  16. $bc_lists[$k]['title_bar'] = Category::where('pid', $v)->column('id,name,image');

Call Stack

  1. in Index.php line 41
  2. at Error->appError() in Index.php line 41
  3. at Index->lists()
  4. at ReflectionMethod->invokeArgs() in Container.php line 343
  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 65
  8. at Pipeline->then() in Controller.php line 113
  9. at Controller->exec() in Dispatch.php line 89
  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 Pipeline.php line 65
  13. at Pipeline->then() in Route.php line 773
  14. at Route->dispatch() in Http.php line 216
  15. at Http->dispatchToRoute() in Http.php line 206
  16. at Http->think\{closure}() in Pipeline.php line 59
  17. at Pipeline->think\{closure}() in MultiApp.php line 71
  18. at MultiApp->think\app\{closure}() in Pipeline.php line 59
  19. at Pipeline->think\{closure}() in Pipeline.php line 65
  20. at Pipeline->then() in MultiApp.php line 72
  21. at MultiApp->handle()
  22. at call_user_func() in Middleware.php line 142
  23. at Middleware->think\{closure}() in Pipeline.php line 84
  24. at Pipeline->think\{closure}() in SessionInit.php line 67
  25. at SessionInit->handle()
  26. at call_user_func() in Middleware.php line 142
  27. at Middleware->think\{closure}() in Pipeline.php line 84
  28. at Pipeline->think\{closure}() in TraceDebug.php line 71
  29. at TraceDebug->handle()
  30. at call_user_func() in Middleware.php line 142
  31. at Middleware->think\{closure}() in Pipeline.php line 84
  32. at Pipeline->think\{closure}() in Pipeline.php line 65
  33. at Pipeline->then() in Http.php line 207
  34. at Http->runWithRequest() in Http.php line 170
  35. at Http->run() in index.php line 20

Environment Variables

GET Dataempty
POST Dataempty
Filesempty
Cookiesempty
Sessionempty
Server/Request Data
USER www
HOME /home/www
HTTP_USER_AGENT claudebot
HTTP_ACCEPT */*
HTTP_HOST www.deformat.com.cn
PATH_INFO
REDIRECT_STATUS 200
SERVER_NAME www.deformat.com.cn
SERVER_PORT 443
SERVER_ADDR 172.17.0.9
REMOTE_PORT 48842
REMOTE_ADDR 184.72.135.210
SERVER_SOFTWARE nginx/1.20.2
GATEWAY_INTERFACE CGI/1.1
HTTPS on
REQUEST_SCHEME https
SERVER_PROTOCOL HTTP/2.0
DOCUMENT_ROOT /www/wwwroot/www.deformat.com.cn/public
DOCUMENT_URI /index.php
REQUEST_URI /lists/108.html
SCRIPT_NAME /index.php
CONTENT_LENGTH
CONTENT_TYPE
REQUEST_METHOD GET
QUERY_STRING s=/lists/108.html
SCRIPT_FILENAME /www/wwwroot/www.deformat.com.cn/public/index.php
FCGI_ROLE RESPONDER
PHP_SELF /index.php
REQUEST_TIME_FLOAT 1711657991.9108
REQUEST_TIME 1711657991