[0] ThrowableError in News.php line 29

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

  1. public function index(){
  2. $redis = new Redis();
  3. $id=$this->params['args']['id'];
  4. $item=model("nav")->where("id=$id")->find()->toArray();
  5. $this->assign('item',$item);
  6. $ids=ids($id);
  7. $list=model("news")->where("pid in($ids)")->order("isTop desc,isRec desc,id desc")->paginate(16,false,['query' => request()->param()]);
  8. $list=model("news")->alias('a')
  9. ->leftJoin('yb_nav b ','b.id= a.pid')

Call Stack

  1. in News.php line 29
  2. at News->index()
  3. at ReflectionMethod->invokeArgs(object(News), []) in Container.php line 395
  4. at Container->invokeReflectMethod(object(News), object(ReflectionMethod), ['id' => '298474', 'convert' => false]) in Module.php line 132
  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 137
  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 24

Environment Variables

GET Dataempty
POST Dataempty
Filesempty
Cookiesempty
Sessionempty
Server/Request Data
USER www
HOME /home/wwwroot
HTTP_ACCEPT_ENCODING gzip
HTTP_ACCEPT */*
HTTP_HOST www.scimdq.com
HTTP_USER_AGENT claudebot
PATH_INFO
PHP_ADMIN_VALUE open_basedir=/home/wwwroot/www.scimdq.com/:/home/wwwroot/scimdq/:/tmp/:/proc/
REDIRECT_STATUS 200
SERVER_NAME scql.scimdq.com
SERVER_PORT 80
SERVER_ADDR 172.18.6.123
REMOTE_PORT 48788
REMOTE_ADDR 104.140.17.122
SERVER_SOFTWARE nginx/1.14.2
GATEWAY_INTERFACE CGI/1.1
REQUEST_SCHEME http
SERVER_PROTOCOL HTTP/1.1
DOCUMENT_ROOT /home/wwwroot/www.scimdq.com
DOCUMENT_URI /index.php
REQUEST_URI /news/298474.shtml
SCRIPT_NAME /index.php
CONTENT_LENGTH
CONTENT_TYPE
REQUEST_METHOD GET
QUERY_STRING s=//news/298474.shtml
SCRIPT_FILENAME /home/wwwroot/www.scimdq.com/index.php
FCGI_ROLE RESPONDER
PHP_SELF
REQUEST_TIME_FLOAT 1711716441.2136
REQUEST_TIME 1711716441
Environment Variablesempty
ThinkPHP Constants
SWOOLE_LIBRARY true
APP_DEBUG false
APP_PATH /mnt/ex/wwwroot/www.scimdq.com/app/
BIND_MODULE index
ROOT_PATH /mnt/ex/wwwroot/www.scimdq.com/
VENDOR_PATH /mnt/ex/wwwroot/www.scimdq.com/vendor/
APP_CACHE_DIR /mnt/ex/wwwroot/www.scimdq.com/data/
DS /