[8] ErrorException in ArticleController.php line 72

Trying to access array offset on value of type null

  1. }
  2. /**
  3. * 文章详情页面
  4. */
  5. public function articleDetails($id, GuArticle $model)
  6. {
  7. $data = $model::get($id);
  8. $model->uvInc($id);
  9. if($data['thumb']!=''){
  10. $webthumb=$data['thumb'];
  11. }else{
  12. $webthumb='http://www.sdswxh.com/public/static/index/img/mylogo.jpg';
  13. }
  14. $this->assign([
  15. 'data' => $data,
  16. 'userData' => $model->userData($data['u_id'], $data->getData('a_status')),
  17. 'webname' => $data['title'],
  18. 'webthumb' => $data['thumb']!=''?$data['thumb']:'/public/static/index/img/mylogo.jpg',

Call Stack

  1. in ArticleController.php line 72
  2. at Error::appError() in ArticleController.php line 72
  3. at ArticleController->articleDetails()
  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 21

Environment Variables

GET Dataempty
POST Dataempty
Filesempty
Cookiesempty
Sessionempty
Server/Request Data
USER www
HOME /home/www
HTTP_HOST www.sdswxh.com
HTTP_REFERER http://sdswxh.com/public/index.php/articledetails/51.html
HTTP_USER_AGENT claudebot
HTTP_ACCEPT */*
PATH_INFO /articledetails/51.html
REDIRECT_STATUS 200
SERVER_NAME sdswxh.com
SERVER_PORT 80
SERVER_ADDR 172.21.243.221
REMOTE_PORT 35616
REMOTE_ADDR 54.205.179.155
SERVER_SOFTWARE nginx/1.21.4
GATEWAY_INTERFACE CGI/1.1
REQUEST_SCHEME http
SERVER_PROTOCOL HTTP/1.1
DOCUMENT_ROOT /www/wwwroot/sdswxh.com
DOCUMENT_URI /public/index.php/articledetails/51.html
REQUEST_URI /public/index.php/articledetails/51.html
SCRIPT_NAME /public/index.php
CONTENT_LENGTH
CONTENT_TYPE
REQUEST_METHOD GET
QUERY_STRING
SCRIPT_FILENAME /www/wwwroot/sdswxh.com/public/index.php
FCGI_ROLE RESPONDER
PHP_SELF /public/index.php/articledetails/51.html
REQUEST_TIME_FLOAT 1710822684.2921
REQUEST_TIME 1710822684
Environment Variablesempty
ThinkPHP Constants
FILTER_VALIDATE_BOOL 258
HTMLPURIFIER_PREFIX /www/wwwroot/sdswxh.com/vendor/ezyang/htmlpurifier/library
URL_CURRENT url://current
URL_RELOAD url://reload
URL_BACK url://back