[0] ThrowableError in Document.php line 47

致命错误: Call to a member function toArray() on null

  1. $table.'.trash' => 0
  2. ];
  3. } else {
  4. $map = [
  5. 'cms_document.status' => 1,
  6. 'cms_document.trash' => 0
  7. ];
  8. }
  9. $info = DocumentModel::getOne($id, $model, $map)->toArray();
  10. $list = Db::name('cms_column')->where('id', $info['cid'])->find();
  11. $info['banner'] = $list['banner'];
  12. if (isset($info['tags'])) {
  13. $info['tags'] = explode(',', $info['tags']);
  14. }
  15. if (isset($info['news_img'])) {
  16. $info['news_img'] = explode(',',$info['news_img']);
  17. }

Call Stack

  1. in Document.php line 47
  2. at Document->detail('43', '')
  3. at ReflectionMethod->invokeArgs(object(Document), ['43', '']) in Container.php line 395
  4. at Container->invokeReflectMethod(object(Document), object(ReflectionMethod), ['id' => '43']) in Module.php line 131
  5. at Module->think\route\dispatch\{closure}(object(Request), object(Closure), null)
  6. at call_user_func_array(object(Closure), [object(Request), object(Closure), null]) in Middleware.php line 185
  7. at Middleware->think\{closure}(object(Request))
  8. at call_user_func(object(Closure), object(Request)) in Middleware.php line 130
  9. at Middleware->dispatch(object(Request), 'controller') in Module.php line 136
  10. at Module->exec() in Dispatch.php line 168
  11. at Dispatch->run() in App.php line 432
  12. at App->think\{closure}(object(Request), object(Closure), null)
  13. at call_user_func_array(object(Closure), [object(Request), object(Closure), null]) in Middleware.php line 185
  14. at Middleware->think\{closure}(object(Request))
  15. at call_user_func(object(Closure), object(Request)) in Middleware.php line 130
  16. at Middleware->dispatch(object(Request)) in App.php line 435
  17. at App->run() in index.php line 33

Environment Variables

GET Dataempty
POST Dataempty
Filesempty
Cookiesempty
Sessionempty
Server/Request Data
USER www
HOME /dev/null
HTTP_HOST bjls.wang
HTTP_USER_AGENT claudebot
HTTP_ACCEPT */*
PATH_INFO /document/detail/id/43.html
REDIRECT_STATUS 200
SERVER_NAME bjls.wang
SERVER_PORT 80
SERVER_ADDR 211.149.156.19
REMOTE_PORT 37480
REMOTE_ADDR 3.81.30.41
SERVER_SOFTWARE nginx/1.18.0
GATEWAY_INTERFACE CGI/1.1
REQUEST_SCHEME http
SERVER_PROTOCOL HTTP/1.1
DOCUMENT_ROOT /www/wwwroot/baijia/public
DOCUMENT_URI /index.php/document/detail/id/43.html
REQUEST_URI /document/detail/id/43.html
SCRIPT_NAME /index.php
CONTENT_LENGTH
CONTENT_TYPE
REQUEST_METHOD GET
QUERY_STRING
SCRIPT_FILENAME /www/wwwroot/baijia/public/index.php
FCGI_ROLE RESPONDER
PHP_SELF /index.php/document/detail/id/43.html
REQUEST_TIME_FLOAT 1711619238.6303
REQUEST_TIME 1711619238
Environment Variablesempty
ThinkPHP Constants
ADMIN_FILE admin.php
HTMLPURIFIER_PREFIX /home/wwwroot/baijia/vendor/ezyang/htmlpurifier/library
PUBLIC_PATH /