#0 [8]ErrorException in Help.php line 20

Trying to get property 'id' of non-object

  1. public function index()
  2. {
  3. $en = input('en');
  4. $categories = HelpCategory::getList();
  5. if (!$en && $categories) {
  6. $en = $categories[0]['en'];
  7. }
  8. $category = HelpCategory::where('en', $en)->find();
  9. $all = \app\common\model\Help::where('status', 1)->field('title,id,path')->select()->toArray();
  10. $list = \app\common\model\Help::where('category_id', $category->id)->where('status', 1)->with('info')->select();
  11. $this->addBread('帮助中心', '/help/');
  12. $this->addBread($category->name);
  13. $seo = AdminConfig::getConfigValue('help_seo', []);
  14. $seoTitle = $category['seo_title'] ?: ($seo['title'] ?? '');
  15. $seoKeyword = $category['seo_keyword'] ?: ($seo['keyword'] ?? '');
  16. $seoDesc = $category['seo_desc'] ?: ($seo['desc'] ?? '');
  17. include template('index');
  18. }

Call Stack

  1. in Help.php line 20
  2. at Error->appError() in Help.php line 20
  3. at Help->index()
  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 AllowCrossDomain.php line 51
  20. at AllowCrossDomain->handle()
  21. at call_user_func() in Middleware.php line 142
  22. at Middleware->think\{closure}() in Pipeline.php line 85
  23. at Pipeline->think\{closure}() in Auth.php line 25
  24. at Auth->handle()
  25. at call_user_func() in Middleware.php line 142
  26. at Middleware->think\{closure}() in Pipeline.php line 85
  27. at Pipeline->think\{closure}() in Pipeline.php line 66
  28. at Pipeline->then() in MultiApp.php line 72
  29. at MultiApp->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 TraceDebug.php line 71
  33. at TraceDebug->handle()
  34. at call_user_func() in Middleware.php line 142
  35. at Middleware->think\{closure}() in Pipeline.php line 85
  36. at Pipeline->think\{closure}() in Pipeline.php line 66
  37. at Pipeline->then() in Http.php line 207
  38. at Http->runWithRequest() in Http.php line 170
  39. at Http->run() in index.php line 20

Environment Variables

GET Dataempty
POST Dataempty
Filesempty
Cookiesempty
Sessionempty
Server/Request Data
USER www-data
HOME /var/www
HTTP_ACCEPT_ENCODING gzip, br, zstd, deflate
HTTP_USER_AGENT Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
HTTP_ACCEPT */*
HTTP_HOST twww.bntyh.com
REDIRECT_STATUS 200
SERVER_NAME twww.bntyh.com
SERVER_PORT 443
SERVER_ADDR 172.19.56.192
REMOTE_USER
REMOTE_PORT 5111
REMOTE_ADDR 216.73.216.223
SERVER_SOFTWARE nginx/1.18.0
GATEWAY_INTERFACE CGI/1.1
HTTPS on
REQUEST_SCHEME https
SERVER_PROTOCOL HTTP/2.0
DOCUMENT_ROOT /home/web/www/bnt_admin/public
DOCUMENT_URI /index.php
REQUEST_URI /help/about_us
SCRIPT_NAME /index.php
CONTENT_LENGTH
CONTENT_TYPE
REQUEST_METHOD GET
QUERY_STRING s=/help/index/en/about_us
PATH_TRANSLATED /home/web/www/bnt_admin/public
PATH_INFO
SCRIPT_FILENAME /home/web/www/bnt_admin/public/index.php
FCGI_ROLE RESPONDER
PHP_SELF /index.php
REQUEST_TIME_FLOAT 1748374898.6295
REQUEST_TIME 1748374898