[0] ThrowableError in IndexController.php line 505

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

  1. } else {
  2. $data = $service->getOneBanner('新闻详情');
  3. }
  4. $this->assign('banner', $data);
  5. $this->assign('nav_name', '新闻中心');
  6. $service = new service\ArticleService();
  7. /*新闻详情*/
  8. $id = $this->request->param('id') . trim('');
  9. $data = $service->getDetail($id);
  10. $this->assign('new', $data->toArray());
  11. /*详情分类*/
  12. $category = $service->getParentName($id);
  13. $this->assign('category', $category);
  14. /*友情链接*/
  15. $links = $service->getLinks('友情链接');
  16. $this->assign('ylinks', $links);
  17. /*产品中心*/
  18. $links = $service->getLinks('产品中心');
  19. $this->assign('plinks', $links);

Call Stack

  1. in IndexController.php line 505
  2. at IndexController->news_info()
  3. at ReflectionMethod->invokeArgs(object(IndexController), []) in App.php line 343
  4. at App::invokeMethod([object(IndexController), 'news_info'], []) in App.php line 611
  5. at App::module(['hx', 'index', 'news_info'], ['app_host' => '', 'app_debug' => true, 'app_trace' => false, ...], true) in App.php line 456
  6. at App::exec(['type' => 'module', 'module' => ['hx', 'index', 'news_info']], ['app_host' => '', 'app_debug' => true, 'app_trace' => false, ...]) in App.php line 139
  7. at App::run() in index.php line 41

Environment Variables

GET Data

id
262
POST Data
empty
Files
empty
Cookies
empty
Session
empty

Server/Request Data

USER
www
HOME
/home/www
HTTP_REFERER
http://www.schxmy.com/hx/index/news_info.html?id=262
HTTP_USER_AGENT
claudebot
HTTP_ACCEPT
*/*
HTTP_HOST
www.schxmy.com
PATH_INFO
hx/index/news_info.html
REDIRECT_STATUS
200
SERVER_NAME
www.schxmy.com
SERVER_PORT
443
SERVER_ADDR
211.149.136.81
REMOTE_PORT
42262
REMOTE_ADDR
44.211.228.24
SERVER_SOFTWARE
nginx/1.22.1
GATEWAY_INTERFACE
CGI/1.1
HTTPS
on
REQUEST_SCHEME
https
SERVER_PROTOCOL
HTTP/2.0
DOCUMENT_ROOT
/home/wwwroot/www.schxmy.com/public
DOCUMENT_URI
/index.php
REQUEST_URI
/hx/index/news_info.html?id=262
SCRIPT_NAME
/index.php
CONTENT_LENGTH
CONTENT_TYPE
REQUEST_METHOD
GET
QUERY_STRING
s=hx/index/news_info.html&id=262
SCRIPT_FILENAME
/home/wwwroot/www.schxmy.com/public/index.php
FCGI_ROLE
RESPONDER
PHP_SELF
/index.php
REQUEST_TIME_FLOAT
1711625044.1942
REQUEST_TIME
1711625044
Environment Variables
empty

ThinkPHP Constants

APP_DEBUG
false
CMF_ROOT
/home/wwwroot/www.schxmy.com/public/../
APP_PATH
/home/wwwroot/www.schxmy.com/public/../app/
CMF_PATH
/home/wwwroot/www.schxmy.com/public/../simplewind/cmf/
PLUGINS_PATH
/home/wwwroot/www.schxmy.com/public/plugins/
EXTEND_PATH
/home/wwwroot/www.schxmy.com/public/../simplewind/extend/
VENDOR_PATH
/home/wwwroot/www.schxmy.com/public/../simplewind/vendor/
RUNTIME_PATH
/home/wwwroot/www.schxmy.com/public/../data/runtime/
THINKCMF_VERSION
5.0.180901
THINK_VERSION
5.0.24
THINK_START_TIME
1711625044.1948
THINK_START_MEM
411576
EXT
.php
DS
/
THINK_PATH
/home/wwwroot/www.schxmy.com/simplewind/thinkphp/
LIB_PATH
/home/wwwroot/www.schxmy.com/simplewind/thinkphp/library/
CORE_PATH
/home/wwwroot/www.schxmy.com/simplewind/thinkphp/library/think/
TRAIT_PATH
/home/wwwroot/www.schxmy.com/simplewind/thinkphp/library/traits/
ROOT_PATH
/home/wwwroot/www.schxmy.com/
LOG_PATH
/home/wwwroot/www.schxmy.com/public/../data/runtime/log/
CACHE_PATH
/home/wwwroot/www.schxmy.com/public/../data/runtime/cache/
TEMP_PATH
/home/wwwroot/www.schxmy.com/public/../data/runtime/temp/
CONF_PATH
/home/wwwroot/www.schxmy.com/public/../app/
CONF_EXT
.php
ENV_PREFIX
PHP_
IS_CLI
false
IS_WIN
false
HTMLPURIFIER_PREFIX
/home/wwwroot/www.schxmy.com/simplewind/vendor/ezyang/htmlpurifier/library
QINIU_FUNCTIONS_VERSION
7.2.5