[8] ErrorException in Cate.php line 225

未定义数组下标: 0

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

Call Stack

  1. in Cate.php line 225
  2. at Error::appError(8, 'Undefined offset: 0', '/data/wwwroot/www.07...', 225, ['cid' => '484', 'data' => [['cid' => 447, 'pid' => 0, 'name' => '关于我们', ...], ['cid' => 448, 'pid' => 0, 'name' => '产品中心', ...], ['cid' => 449, 'pid' => 0, 'name' => '行业应用', ...], ...], 'cat' => object(Category), ...]) in Cate.php line 225
  3. at Cate->get_top_category('484') in Cate.php line 35
  4. at Cate->listt()
  5. at ReflectionMethod->invokeArgs(object(Cate), []) in Container.php line 395
  6. at Container->invokeReflectMethod(object(Cate), object(ReflectionMethod), ['cid' => '484', '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 23

Environment Variables

GET Dataempty
POST Dataempty
Filesempty
Cookiesempty
Sessionempty
Server/Request Data
USER www
HOME /home/www
HTTP_USER_AGENT claudebot
HTTP_ACCEPT */*
HTTP_HOST 0773lg.org.cn
PATH_INFO
REDIRECT_STATUS 200
SERVER_NAME www.0773lg.org.cn
SERVER_PORT 443
SERVER_ADDR 172.17.241.15
REMOTE_PORT 40958
REMOTE_ADDR 3.85.63.190
SERVER_SOFTWARE nginx/1.22.1
GATEWAY_INTERFACE CGI/1.1
HTTPS on
REQUEST_SCHEME https
SERVER_PROTOCOL HTTP/2.0
DOCUMENT_ROOT /data/wwwroot/www.0773lg.org.cn
DOCUMENT_URI /index.php
REQUEST_URI /cate/484.html
SCRIPT_NAME /index.php
CONTENT_LENGTH
CONTENT_TYPE
REQUEST_METHOD GET
QUERY_STRING s=/cate/484.html
SCRIPT_FILENAME /data/wwwroot/www.0773lg.org.cn/index.php
FCGI_ROLE RESPONDER
PHP_SELF /index.php
REQUEST_TIME_FLOAT 1710844227.2233
REQUEST_TIME 1710844227
Environment Variablesempty
ThinkPHP Constants
BIND_MODULE index