[8] ErrorException in Cate.php line 421

未定义数组下标: 0

  1. }
  2. //返回当前最顶层栏目
  3. protected function get_top_category($cid = 0) {
  4. $data = Db::name($this->tb_config['cate_tb'])->field('cid,pid,name,cname,icon,tpl_category,tpl_post,mid,sort,menu')->where(['status'=>1])->order("sort asc,cid asc")->select();
  5. $cat = new cat(array('cid', 'pid', 'name', 'cname')); //初始化无限分类
  6. $list = $cat->getPath($data, $cid); //获取分类数据树结构
  7. return $list[0];
  8. }
  9. //子栏目所有CID
  10. protected function get_child_id($pid = 0, $condition = '1=1') {
  11. //查询分类信息
  12. $data = Db::name($this->tb_config['cate_tb'])->field('cid,pid,name')->where($condition)->order("sort asc,cid asc")->select();
  13. $cat = new cat(array('cid', 'pid', 'name', 'cname')); //初始化无限分类
  14. $child_array = $cat->getTree($data, $pid);//获取分类数据树结构
  15. if(is_array($child_array) && !empty($child_array)){
  16. $child_cid[] = $pid;

Call Stack

  1. in Cate.php line 421
  2. at Error::appError(8, 'Undefined offset: 0', '/www/wwwroot/alinx.c...', 421, ['cid' => '83', 'data' => [['cid' => 80, 'pid' => 75, 'name' => '人工智能', ...], ['cid' => 92, 'pid' => 76, 'name' => '天猫旗舰店', ...], ['cid' => 93, 'pid' => 76, 'name' => '...', ...], ...], 'cat' => object(Category), ...]) in Cate.php line 421
  3. at Cate->get_top_category('83') in Cate.php line 59
  4. at Cate->listt()
  5. at ReflectionMethod->invokeArgs(object(Cate), []) in Container.php line 395
  6. at Container->invokeReflectMethod(object(Cate), object(ReflectionMethod), ['cid' => '83', 'lang' => '', 'convert' => false]) in Module.php line 131
  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 136
  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 22

Environment Variables

GET Dataempty
POST Dataempty
Filesempty
Cookiesempty
Sessionempty
Server/Request Data
USER www
HOME /home/www
FCGI_ROLE RESPONDER
SCRIPT_FILENAME /www/wwwroot/alinx.cn/index.php
QUERY_STRING s=/cate/83
REQUEST_METHOD GET
CONTENT_TYPE
CONTENT_LENGTH
SCRIPT_NAME /index.php
REQUEST_URI //cate/83
DOCUMENT_URI /index.php
DOCUMENT_ROOT /www/wwwroot/alinx.cn
SERVER_PROTOCOL HTTP/1.1
REQUEST_SCHEME https
HTTPS on
GATEWAY_INTERFACE CGI/1.1
SERVER_SOFTWARE nginx/1.16.0
REMOTE_ADDR 163.181.67.168
REMOTE_PORT 39070
SERVER_ADDR 172.20.185.139
SERVER_PORT 443
SERVER_NAME www.alinx.com
REDIRECT_STATUS 200
PATH_INFO
HTTP_HOST www.alinx.com
HTTP_VIA us18.l1, ens-cache11.us18, l2us1.l2, cache20.l2us1
HTTP_EAGLEEYE_TRACEID 2ff6189717116213146661408e
HTTP_ALI_SWIFT_LOG_HOST www.alinx.com
HTTP_ALI_SWIFT_STAT_HOST level2.www.alinx.com
HTTP_X_FORWARDED_FOR 44.222.249.19
HTTP_X_CLIENT_SCHEME https
HTTP_ALI_CDN_REAL_IP 44.222.249.19
HTTP_ACCEPT */*
HTTP_USER_AGENT claudebot
PHP_SELF /index.php
REQUEST_TIME_FLOAT 1711621318.9086
REQUEST_TIME 1711621318
Environment Variablesempty
ThinkPHP Constantsempty