[8] ErrorException in News.php line 67

未定义数组下标: 0

  1. # 获取详情
  2. $detail = ArticleModel::get($id);
  3. $this->assign('detail', $detail);
  4. # 获取栏目信息
  5. $navs = cache('navs')->toArray();
  6. $nav = array_filter($navs, function ($nav) use ($detail) {
  7. return $nav['id'] == $detail['fid'];
  8. });
  9. $nav = array_values($nav)[0];
  10. $bannerInfo = [
  11. 'title' => $nav['banner_title'],
  12. 'info' => $nav['banner_info'],
  13. 'image' => $nav['banner']
  14. ];
  15. $this->assign('banner_info', $bannerInfo);
  16. # seo
  17. $seo_d_title = $detail['seo_title'] ? $detail['seo_title'] : $detail['title'];

Call Stack

  1. in News.php line 67
  2. at Error::appError(8, 'Undefined offset: 0', '/www/wwwroot/partner...', 67, ['id' => 'detail', 'detail' => null, 'navs' => [['id' => 14, 'fid' => 7, 'name' => 'FAQ', ...], ['id' => 13, 'fid' => 7, 'name' => '在线学习', ...], ['id' => 12, 'fid' => 7, 'name' => '培训介绍', ...], ...], ...]) in News.php line 67
  3. at News->detail()
  4. at ReflectionMethod->invokeArgs(object(News), []) in Container.php line 395
  5. at Container->invokeReflectMethod(object(News), object(ReflectionMethod), ['id' => 'detail', 'convert' => false]) in Module.php line 131
  6. at Module->think\route\dispatch\{closure}(object(Request), object(Closure), null)
  7. at call_user_func_array(object(Closure), [object(Request), object(Closure), null]) in Middleware.php line 185
  8. at Middleware->think\{closure}(object(Request))
  9. at call_user_func(object(Closure), object(Request)) in Middleware.php line 130
  10. at Middleware->dispatch(object(Request), 'controller') in Module.php line 136
  11. at Module->exec() in Dispatch.php line 168
  12. at Dispatch->run() in App.php line 432
  13. at App->think\{closure}(object(Request), object(Closure), null)
  14. at call_user_func_array(object(Closure), [object(Request), object(Closure), null]) in Middleware.php line 185
  15. at Middleware->think\{closure}(object(Request))
  16. at call_user_func(object(Closure), object(Request)) in Middleware.php line 130
  17. at Middleware->dispatch(object(Request)) in App.php line 435
  18. 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 partner.dbsec.cn
HTTP_USER_AGENT claudebot
HTTP_ACCEPT */*
PATH_INFO
REDIRECT_STATUS 200
SERVER_NAME partner.dbsec.cn
SERVER_PORT 443
SERVER_ADDR 172.17.97.22
REMOTE_PORT 46178
REMOTE_ADDR 52.91.0.68
SERVER_SOFTWARE nginx/1.8.1
GATEWAY_INTERFACE CGI/1.1
HTTPS on
SERVER_PROTOCOL HTTP/1.1
DOCUMENT_ROOT /www/wwwroot/partner.dbsec.cn/public
DOCUMENT_URI /index.php
REQUEST_URI /news/detail/20
SCRIPT_NAME /index.php
CONTENT_LENGTH
CONTENT_TYPE
REQUEST_METHOD GET
QUERY_STRING s=/news/detail/20
SCRIPT_FILENAME /www/wwwroot/partner.dbsec.cn/public/index.php
FCGI_ROLE RESPONDER
PHP_SELF /index.php
REQUEST_TIME_FLOAT 1711627372.4521
REQUEST_TIME 1711627372
Environment Variablesempty
ThinkPHP Constantsempty