[8] ErrorException in Base.php line 123

未定义数组索引: article_sub

  1. public function getArticleInfo(){
  2. $id = $this->request->param('id','');
  3. if(empty($id)){
  4. $this->error('缺少参数');
  5. }
  6. $info = Article::with('articleSub')
  7. ->field('id,title,subtitle,cid,author,click,picture,seo_t,seo_k,seo_d,intro,create_time')
  8. ->find($id);
  9. $info['imgs'] = explode(',',$info['article_sub']['imgs']);
  10. $info['content'] = $info['article_sub']['content'];
  11. unset($info['article_sub']);
  12. Db::name('article')->where('id',$id)->setInc('click');
  13. return $info;
  14. }
  15. /**
  16. * 获取某个导航下级
  17. */

Call Stack

  1. in Base.php line 123
  2. at Error::appError(8, 'Undefined index: art...', '/usr/home/byu5440540...', 123, ['id' => '137', 'info' => ['imgs' => ['']]]) in Base.php line 123
  3. at Base->getArticleInfo() in Base.php line 67
  4. at Base->detail()
  5. at ReflectionMethod->invokeArgs(object(Business), []) in Container.php line 395
  6. at Container->invokeReflectMethod(object(Business), object(ReflectionMethod), ['id' => '137']) in Module.php line 143
  7. at Module->think\route\dispatch\{closure}(object(Request), object(Closure), null)
  8. at call_user_func_array(object(Closure), [object(Request), object(Closure), null]) in Middleware.php line 185
  9. at Middleware->think\{closure}(object(Request))
  10. at call_user_func(object(Closure), object(Request)) in Middleware.php line 130
  11. at Middleware->dispatch(object(Request), 'controller') in Module.php line 148
  12. at Module->exec() in Dispatch.php line 168
  13. at Dispatch->run() in App.php line 432
  14. at App->think\{closure}(object(Request), object(Closure), null)
  15. at call_user_func_array(object(Closure), [object(Request), object(Closure), null]) in Middleware.php line 185
  16. at Middleware->think\{closure}(object(Request))
  17. at call_user_func(object(Closure), object(Request)) in Middleware.php line 130
  18. at Middleware->dispatch(object(Request)) in App.php line 435
  19. at App->run() in index.php line 21

Environment Variables

GET Dataempty
POST Dataempty
Filesempty
Cookiesempty
Sessionempty
Server/Request Data
DOCUMENT_ROOT /usr/home/byu5440540001/htdocs
GATEWAY_INTERFACE CGI/1.1
HTTP_ACCEPT */*
HTTP_HOST www.glzy.cn
HTTP_USER_AGENT claudebot
PATH /bin
PHPRC /var/www/php72/hichina_ini/byu5440540001
QUERY_STRING
REDIRECT_DOCUMENT_ROOT /usr/home/byu5440540001/htdocs
REDIRECT_GATEWAY_INTERFACE CGI/1.1
REDIRECT_HTTP_ACCEPT */*
REDIRECT_HTTP_HOST www.glzy.cn
REDIRECT_HTTP_USER_AGENT claudebot
REDIRECT_PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
REDIRECT_PATH_INFO /business/detail/id/137.html
REDIRECT_PATH_TRANSLATED redirect:/index.php/business/detail/id/137.html/detail/id/137.html
REDIRECT_QUERY_STRING
REDIRECT_REMOTE_ADDR 3.236.81.4
REDIRECT_REMOTE_PORT 33206
REDIRECT_REQUEST_METHOD GET
REDIRECT_REQUEST_URI /index/business/detail/id/137.html
REDIRECT_SCRIPT_FILENAME /usr/home/byu5440540001/htdocs/index
REDIRECT_SCRIPT_NAME /index
REDIRECT_SCRIPT_URI http://www.glzy.cn/index/business/detail/id/137.html
REDIRECT_SCRIPT_URL /index/business/detail/id/137.html
REDIRECT_SERVER_ADDR 10.22.93.162
REDIRECT_SERVER_ADMIN webmaster@byu5440540001.my3w.com
REDIRECT_SERVER_NAME www.glzy.cn
REDIRECT_SERVER_PORT 80
REDIRECT_SERVER_PROTOCOL HTTP/1.1
REDIRECT_SERVER_SIGNATURE
REDIRECT_SERVER_SOFTWARE Apache
REDIRECT_STATUS 200
REDIRECT_TZ Asia/Shanghai
REDIRECT_UNIQUE_ID ZgaYNwoWXaIAOUGmx5gAAAAD
REDIRECT_URL /index/business/detail/id/137.html
REMOTE_ADDR 3.236.81.4
REMOTE_PORT 33206
REQUEST_METHOD GET
REQUEST_URI /index/business/detail/id/137.html
SCRIPT_FILENAME /usr/home/byu5440540001/htdocs/index.php
SCRIPT_NAME /index.php
SCRIPT_URI http://www.glzy.cn/index/business/detail/id/137.html
SCRIPT_URL /index/business/detail/id/137.html
SERVER_ADDR 10.22.93.162
SERVER_ADMIN webmaster@byu5440540001.my3w.com
SERVER_NAME www.glzy.cn
SERVER_PORT 80
SERVER_PROTOCOL HTTP/1.1
SERVER_SIGNATURE
SERVER_SOFTWARE Apache
TZ Asia/Shanghai
UNIQUE_ID ZgaYNwoWXaIAOUGmx5gAAAAD
ORIG_PATH_INFO /index/business/detail/id/137.html
ORIG_PATH_TRANSLATED /usr/home/byu5440540001/htdocs/index.php
PHP_SELF /index.php
REQUEST_TIME_FLOAT 1711708215.0781
REQUEST_TIME 1711708215
Environment Variablesempty
ThinkPHP Constants
APP_PATH /usr/home/byu5440540001/htdocs/application/