#0 [0]Error in News.php line 54

Call to a member function toArray() on null

  1. $type = $this->request->get('type',18);
  2. $data = [];
  3. $data['t'] = $type;
  4. $banner = new model\BocBanner();
  5. $banner_list = $banner->get_banner(6);
  6. $data['banner'] = $banner_list;
  7. $BocNews = new model\BocNews();
  8. $data['list'] = $BocNews->field('cate_id,title,author,content,sort,create_at,click_num,left(create_at,10) as ym,description,keywords')->where(['id' => $id, 'status' => 1, 'is_deleted' => 0])->find()->toArray();
  9. # 查询seo
  10. $data['title'] = $data['list']['title'];
  11. $data['description'] = $data['list']['description'];
  12. $data['keywords'] = $data['list']['keywords'];
  13. # 添加点击次数
  14. $BocNews->where(['id' => $id])->Inc('click_num', 1)->update();

Call Stack

  1. in News.php line 54
  2. at News->detail()
  3. at ReflectionMethod->invokeArgs() in Container.php line 344
  4. at Container->invokeReflectMethod() in Controller.php line 110
  5. at Controller->think\route\dispatch\{closure}() in Pipeline.php line 59
  6. at Pipeline->think\{closure}() in Pipeline.php line 66
  7. at Pipeline->then() in Controller.php line 113
  8. at Controller->exec() in Dispatch.php line 90
  9. at Dispatch->run() in Route.php line 785
  10. at Route->think\{closure}() in Pipeline.php line 59
  11. at Pipeline->think\{closure}() in Library.php line 150
  12. at Library->think\admin\{closure}()
  13. at call_user_func() in Middleware.php line 142
  14. at Middleware->think\{closure}() in Pipeline.php line 85
  15. at Pipeline->think\{closure}() in Pipeline.php line 66
  16. at Pipeline->then() in Route.php line 786
  17. at Route->dispatch() in Http.php line 216
  18. at Http->dispatchToRoute() in Http.php line 206
  19. at Http->think\{closure}() in Pipeline.php line 59
  20. at Pipeline->think\{closure}() in Multiple.php line 81
  21. at Multiple->think\admin\support\middleware\{closure}() in Pipeline.php line 59
  22. at Pipeline->think\{closure}() in Pipeline.php line 66
  23. at Pipeline->then() in Multiple.php line 82
  24. at Multiple->handle()
  25. at call_user_func() in Middleware.php line 142
  26. at Middleware->think\{closure}() in Pipeline.php line 85
  27. at Pipeline->think\{closure}() in LoadLangPack.php line 57
  28. at LoadLangPack->handle()
  29. at call_user_func() in Middleware.php line 142
  30. at Middleware->think\{closure}() in Pipeline.php line 85
  31. at Pipeline->think\{closure}() in JwtInit.php line 119
  32. at JwtInit->handle()
  33. at call_user_func() in Middleware.php line 142
  34. at Middleware->think\{closure}() in Pipeline.php line 85
  35. at Pipeline->think\{closure}() in Pipeline.php line 66
  36. at Pipeline->then() in Http.php line 207
  37. at Http->runWithRequest() in Http.php line 170
  38. at Http->run() in RuntimeService.php line 214
  39. at RuntimeService::doWebsiteInit() in SystemService.php line 416
  40. at SystemService::__callStatic() in SystemService.php line 391
  41. at SystemService->__call() in index.php line 25

Environment Variables

GET Dataempty
POST Dataempty
Filesempty
Cookiesempty
Sessionempty
Server/Request Data
USER www
HOME /home/www
HTTP_HOST www.qddpjc.cn
HTTP_USER_AGENT claudebot
HTTP_ACCEPT */*
PATH_INFO /news/detail/20.html
REDIRECT_STATUS 200
SERVER_NAME www.qddpjc.cn
SERVER_PORT 80
SERVER_ADDR 172.21.126.143
REMOTE_PORT 41838
REMOTE_ADDR 44.201.64.238
SERVER_SOFTWARE nginx/1.20.2
GATEWAY_INTERFACE CGI/1.1
REQUEST_SCHEME http
SERVER_PROTOCOL HTTP/1.1
DOCUMENT_ROOT /www/wwwroot/dpjc/public
DOCUMENT_URI /index.php/news/detail/20.html
REQUEST_URI /index.php/news/detail/20.html
SCRIPT_NAME /index.php
CONTENT_LENGTH
CONTENT_TYPE
REQUEST_METHOD GET
QUERY_STRING
SCRIPT_FILENAME /www/wwwroot/dpjc/public/index.php
FCGI_ROLE RESPONDER
PHP_SELF /index.php/news/detail/20.html
REQUEST_TIME_FLOAT 1711612780.1886
REQUEST_TIME 1711612780