#0 [8]ErrorException in Sub.php line 49

Trying to get property 'id' of non-object

  1. }
  2. public function category($category_name)
  3. {
  4. // 获取该站点信息
  5. $site = SiteService::getSite($this->request->domain());
  6. $categories = Category::select();
  7. $category = Category::where('dir_name', $category_name)->find();
  8. $articles = Article::where('site_id', $site->id)
  9. ->where('category_id', $category->id)
  10. ->paginate();
  11. $hots = ArticleService::getHots($site->id);
  12. $links = LinkService::getLink();
  13. $tops = Article::where('site_id', $site->id)
  14. ->where('is_top', 1)
  15. ->order('update_time', 'by desc')
  16. ->limit(11)
  17. ->select();
  18. $template_name = $site->template->template_name ? $site->template->template_name : '/index/sub';

Call Stack

  1. in Sub.php line 49
  2. at Error->appError() in Sub.php line 49
  3. at Sub->category()
  4. at ReflectionMethod->invokeArgs() in Container.php line 344
  5. at Container->invokeReflectMethod() in Controller.php line 110
  6. at Controller->think\route\dispatch\{closure}() in Pipeline.php line 59
  7. at Pipeline->think\{closure}() in Pipeline.php line 66
  8. at Pipeline->then() in Controller.php line 113
  9. at Controller->exec() in Dispatch.php line 90
  10. at Dispatch->run() in Route.php line 772
  11. at Route->think\{closure}() in Pipeline.php line 59
  12. at Pipeline->think\{closure}() in Pipeline.php line 66
  13. at Pipeline->then() in Route.php line 773
  14. at Route->dispatch() in Http.php line 216
  15. at Http->dispatchToRoute() in Http.php line 206
  16. at Http->think\{closure}() in Pipeline.php line 59
  17. at Pipeline->think\{closure}() in MultiApp.php line 71
  18. at MultiApp->think\app\{closure}() in Pipeline.php line 59
  19. at Pipeline->think\{closure}() in Pipeline.php line 66
  20. at Pipeline->then() in MultiApp.php line 72
  21. at MultiApp->handle()
  22. at call_user_func() in Middleware.php line 142
  23. at Middleware->think\{closure}() in Pipeline.php line 85
  24. at Pipeline->think\{closure}() in SessionInit.php line 67
  25. at SessionInit->handle()
  26. at call_user_func() in Middleware.php line 142
  27. at Middleware->think\{closure}() in Pipeline.php line 85
  28. at Pipeline->think\{closure}() in TraceDebug.php line 71
  29. at TraceDebug->handle()
  30. at call_user_func() in Middleware.php line 142
  31. at Middleware->think\{closure}() in Pipeline.php line 85
  32. at Pipeline->think\{closure}() in Pipeline.php line 66
  33. at Pipeline->then() in Http.php line 207
  34. at Http->runWithRequest() in Http.php line 170
  35. at Http->run() in index.php line 20

Environment Variables

GET Dataempty
POST Dataempty
Filesempty
Cookiesempty
Session
file { "web_logo": "" }
system { "admin_name": "CMS\u540e\u53f0\u7ba1\u7406", "web_name": "", "keywords": "CMS,\u7f51\u7ad9", "copyright": "ico-\u5907\u6848\u53f7", "desc": "CMS\u5efa\u7ad9\u7cfb\u7edf...", "web_title": "", "admin_title": "", "domain_prefix": "web.o0u.cn" }
Server/Request Data
USER www
HOME /home/www
HTTP_HOST www.tsche.cn
HTTP_USER_AGENT claudebot
HTTP_ACCEPT */*
PATH_INFO
REDIRECT_STATUS 200
SERVER_NAME www.iautow.cn
SERVER_PORT 80
SERVER_ADDR 103.108.193.77
REMOTE_PORT 38418
REMOTE_ADDR 44.203.58.132
SERVER_SOFTWARE nginx/1.20.2
GATEWAY_INTERFACE CGI/1.1
REQUEST_SCHEME http
SERVER_PROTOCOL HTTP/1.1
DOCUMENT_ROOT /www/wwwroot/www.icarw.cn/public
DOCUMENT_URI /index.php
REQUEST_URI /vip.html
SCRIPT_NAME /index.php
CONTENT_LENGTH
CONTENT_TYPE
REQUEST_METHOD GET
QUERY_STRING s=//vip.html
SCRIPT_FILENAME /www/wwwroot/www.icarw.cn/public/index.php
FCGI_ROLE RESPONDER
PHP_SELF /index.php
REQUEST_TIME_FLOAT 1711635081.0912
REQUEST_TIME 1711635081
0.021836s