[0] ThrowableError in News.php line 77

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

  1. $where['urlname'] = $id;
  2. //}
  3. }
  4. if(input('lang'))
  5. {
  6. $where['lang'] = input('lang');
  7. }else{
  8. $where['lang'] = cookie('lang');
  9. }
  10. $newsDetail = $this->model->where($where)->find()->toArray();
  11. $this->view->assign('newsDetail',$newsDetail);
  12. $newsList=$this->model->where(['lang'=>cookie('lang'),'status'=>1])->where('id','neq',$newsDetail['id'])->order('id desc')->limit(6)->select();
  13. $this->view->assign('newsList',$newsList);
  14. $catalogName = Db::name('category')->where(['type'=>'news','id'=>$newsDetail['category_id']])->find();
  15. $this->view->assign('category', $catalogName);
  16. $this->view->assign('thisNav','news');
  17. return $this->view->fetch();
  18. }
  19. public function ajaxnews()

Call Stack

  1. in News.php line 77
  2. at News->detail()
  3. at ReflectionMethod->invokeArgs(object(News), []) in App.php line 343
  4. at App::invokeMethod([object(News), 'detail'], []) in App.php line 598
  5. at App::module(['index', 'news', 'detail'], ['app_host' => '', 'app_debug' => true, 'app_trace' => false, ...], false) in App.php line 456
  6. at App::exec(['type' => 'module', 'module' => ['index', 'news', 'detail'], 'convert' => false], ['app_host' => '', 'app_debug' => true, 'app_trace' => false, ...]) in App.php line 139
  7. at App::run() in start.php line 19
  8. at require('/www/wwwroot/huayi/t...') in index.php line 17

Environment Variables

GET Data
empty
POST Data
empty
Files
empty

Cookies

lang
en
Session
empty

Server/Request Data

USER
www
HOME
/home/www
HTTP_USER_AGENT
claudebot
HTTP_ACCEPT
*/*
HTTP_HOST
www.huayijx.com
PATH_INFO
/newdetail/rubber-machine-%20maintenance-methods
REDIRECT_STATUS
200
SERVER_NAME
www.hwayimachine.com
SERVER_PORT
443
SERVER_ADDR
172.29.35.199
REMOTE_PORT
55768
REMOTE_ADDR
35.171.159.141
SERVER_SOFTWARE
nginx/1.18.0
GATEWAY_INTERFACE
CGI/1.1
HTTPS
on
REQUEST_SCHEME
https
SERVER_PROTOCOL
HTTP/2.0
DOCUMENT_ROOT
/www/wwwroot/huayi/public
DOCUMENT_URI
/index.php
REQUEST_URI
/newdetail/rubber-machine-%2520maintenance-methods
SCRIPT_NAME
/index.php
CONTENT_LENGTH
CONTENT_TYPE
REQUEST_METHOD
GET
QUERY_STRING
s=/newdetail/rubber-machine-%2520maintenance-methods
SCRIPT_FILENAME
/www/wwwroot/huayi/public/index.php
FCGI_ROLE
RESPONDER
PHP_SELF
/index.php
REQUEST_TIME_FLOAT
1711639369.5901
REQUEST_TIME
1711639369
Environment Variables
empty

ThinkPHP Constants

APP_PATH
/www/wwwroot/huayi/public/../application/
THINK_VERSION
5.0.15
THINK_START_TIME
1711639369.5907
THINK_START_MEM
404304
EXT
.php
DS
/
THINK_PATH
/www/wwwroot/huayi/thinkphp/
LIB_PATH
/www/wwwroot/huayi/thinkphp/library/
CORE_PATH
/www/wwwroot/huayi/thinkphp/library/think/
TRAIT_PATH
/www/wwwroot/huayi/thinkphp/library/traits/
ROOT_PATH
/www/wwwroot/huayi/
EXTEND_PATH
/www/wwwroot/huayi/extend/
VENDOR_PATH
/www/wwwroot/huayi/vendor/
RUNTIME_PATH
/www/wwwroot/huayi/runtime/
LOG_PATH
/www/wwwroot/huayi/runtime/log/
CACHE_PATH
/www/wwwroot/huayi/runtime/cache/
TEMP_PATH
/www/wwwroot/huayi/runtime/temp/
CONF_PATH
/www/wwwroot/huayi/public/../application/
CONF_EXT
.php
ENV_PREFIX
PHP_
IS_CLI
false
IS_WIN
false
ADDON_PATH
/www/wwwroot/huayi/addons/