[0] ThrowableError in Index.php line 1723

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

  1. }
  2. $juti_id = $request->param('id'); //具体贴吧的id
  3. cache::tag('postbar')->remember('get_postbarinfo_by_'.$juti_id,function()use($juti_id){
  4. return $info = YhPostbar::with(['getAnswer'=>function($query){
  5. $query->where('yh_anwser_type',20)->order('yh_anwser_created_at','desc');
  6. },'getTag'=>function($query){
  7. $query->field('yh_tag_id,yh_tag_name');
  8. },'getLogo'=>function($query){
  9. $query->field('yh_data_id,yh_data_short,yh_data_logo,yh_data_title');
  10. },'getImg'])->where('yh_postbar_id',$juti_id)->where('yh_postbar_ischeck',1)->find()->toArray();
  11. },config('cachetag.tag.postbar.timeout'));
  12. $info = cache::get('get_postbarinfo_by_'.$juti_id);
  13. $cate = YhCategory::where([
  14. 'yh_cate_id' => $info['yh_postbar_cateid']
  15. ])->find();
  16. $this->assign('cate',$cate);
  17. // 计数统计
  18. $total = new Total;
  19. $total->getEveryPageTotal('postbar',$juti_id,$info['yh_postbar_tagid'],$info['yh_postbar_memid']);

Call Stack

  1. in Index.php line 1723
  2. at Index->app\index\controller\{closure}()
  3. at call_user_func_array(object(Closure), []) in Container.php line 347
  4. at Container->invokeFunction(object(Closure)) in Driver.php line 185
  5. at Driver->remember('get_postbarinfo_by_6...', object(Closure), 3600) in Index.php line 1724
  6. at Index->tbDetails(object(Request))
  7. at ReflectionMethod->invokeArgs(object(Index), [object(Request)]) in Container.php line 395
  8. at Container->invokeReflectMethod(object(Index), object(ReflectionMethod), ['id' => '605', 'convert' => false]) in Module.php line 132
  9. at Module->think\route\dispatch\{closure}(object(Request), object(Closure), null)
  10. at call_user_func_array(object(Closure), [object(Request), object(Closure), null]) in Middleware.php line 185
  11. at Middleware->think\{closure}(object(Request))
  12. at call_user_func(object(Closure), object(Request)) in Middleware.php line 130
  13. at Middleware->dispatch(object(Request), 'controller') in Module.php line 137
  14. at Module->exec() in Dispatch.php line 168
  15. at Dispatch->run() in App.php line 432
  16. at App->think\{closure}(object(Request), object(Closure), null)
  17. at call_user_func_array(object(Closure), [object(Request), object(Closure), null]) in Middleware.php line 185
  18. at Middleware->think\{closure}(object(Request))
  19. at call_user_func(object(Closure), object(Request)) in Middleware.php line 130
  20. at Middleware->dispatch(object(Request)) in App.php line 435
  21. 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.yh596.com
HTTP_USER_AGENT claudebot
HTTP_ACCEPT */*
PATH_INFO
REDIRECT_STATUS 200
SERVER_NAME www.yh596.com
SERVER_PORT 80
SERVER_ADDR 172.26.193.191
REMOTE_PORT 46788
REMOTE_ADDR 18.209.209.246
SERVER_SOFTWARE nginx/1.19.0
GATEWAY_INTERFACE CGI/1.1
REQUEST_SCHEME http
SERVER_PROTOCOL HTTP/1.1
DOCUMENT_ROOT /www/wwwroot/www.yh596.com/public
DOCUMENT_URI /index.php
REQUEST_URI /index/tbdt/605
SCRIPT_NAME /index.php
CONTENT_LENGTH
CONTENT_TYPE
REQUEST_METHOD GET
QUERY_STRING s=/index/tbdt/605
SCRIPT_FILENAME /www/wwwroot/www.yh596.com/public/index.php
FCGI_ROLE RESPONDER
PHP_SELF /index.php
REQUEST_TIME_FLOAT 1711653076.0944
REQUEST_TIME 1711653076
Environment Variablesempty
ThinkPHP Constantsempty