[8] ErrorException in Cate.php line 63

未定义数组索引:

  1. // 1 => 0,
  2. // // 省略...
  3. // 5 => 1,
  4. // // 省略...
  5. // 13 => 5
  6. // ];
  7. // 建议将这数组缓存起来
  8. $id = $cid;
  9. while($arr[$id]) {
  10. $id = $arr[$id];
  11. }
  12. return $id; // 1
  13. }
  14. public function getPageContent($cid){
  15. $cates=$this->field('content')->find($cid);
  16. $content=strip_tags($cates['content']);
  17. $content=cut_str($content,66);

Call Stack

  1. in Cate.php line 63
  2. at Error::appError(8, 'Undefined index: ', '/www/wwwroot/yunyao/...', 63, ['cid' => null, 'data' => [['id' => 21, 'pid' => 0], ['id' => 28, 'pid' => 23], ['id' => 29, 'pid' => 23], ...], 'arr' => [0, 23, 23, ...], ...]) in Cate.php line 63
  3. at Cate->getTopId(null) in Article.php line 21
  4. at Article->index('154')
  5. at ReflectionMethod->invokeArgs(object(Article), ['154']) in App.php line 224
  6. at App::invokeMethod([object(Article), 'index'], []) in App.php line 389
  7. at App::module(['index', 'article', 'index'], ['app_namespace' => 'app', 'app_debug' => 1, 'app_trace' => 1, ...], true) in App.php line 130
  8. at App::run() in start.php line 18
  9. at require('/www/wwwroot/yunyao/...') in index.php line 29

Exception Datas

Error Context
cid
Resource
data
[ { "id": 21, "pid": 0 }, { "id": 28, "pid": 23 }, { "id": 29, "pid": 23 }, { "id": 30, "pid": 23 }, { "id": 31, "pid": 0 }, { "id": 32, "pid": 0 }, { "id": 33, "pid": 0 }, { "id": 34, "pid": 0 }, { "id": 22, "pid": 0 }, { "id": 23, "pid": 0 }, { "id": 24, "pid": 0 }, { "id": 25, "pid": 0 }, { "id": 26, "pid": 0 }, { "id": 36, "pid": 0 }, { "id": 37, "pid": 0 }, { "id": 38, "pid": 0 }, { "id": 40, "pid": 0 }, { "id": 41, "pid": 0 }, { "id": 43, "pid": 0 } ]
arr
{ "21": 0, "28": 23, "29": 23, "30": 23, "31": 0, "32": 0, "33": 0, "34": 0, "22": 0, "23": 0, "24": 0, "25": 0, "26": 0, "36": 0, "37": 0, "38": 0, "40": 0, "41": 0, "43": 0 }
v
{ "id": 43, "pid": 0 }
k
18
id
Resource

Environment Variables

GET Dataempty
POST Dataempty
Filesempty
Cookiesempty
Sessionempty
Server/Request Data
USER
www
HOME
/home/www
HTTP_ACCEPT_ENCODING
deflate, gzip
HTTP_ACCEPT
*/*
HTTP_HOST
www.yunyaoo.com
HTTP_USER_AGENT
Mozilla/5.0+(compatible;+Baiduspider/2.0;++http://www.baidu.com/search/spider.html)
PATH_INFO
/index/article/index/j/cases/aid/154.html
REDIRECT_STATUS
200
SERVER_NAME
www.yunyaoo.com
SERVER_PORT
443
SERVER_ADDR
172.16.0.17
REMOTE_PORT
20003
REMOTE_ADDR
168.76.47.109
SERVER_SOFTWARE
nginx/1.21.0
GATEWAY_INTERFACE
CGI/1.1
HTTPS
on
REQUEST_SCHEME
https
SERVER_PROTOCOL
HTTP/1.1
DOCUMENT_ROOT
/www/wwwroot/yunyao/public
DOCUMENT_URI
/index.php
REQUEST_URI
/index/article/index/j/cases/aid/154.html
SCRIPT_NAME
/index.php
CONTENT_LENGTH
CONTENT_TYPE
REQUEST_METHOD
GET
QUERY_STRING
s=/index/article/index/j/cases/aid/154.html
SCRIPT_FILENAME
/www/wwwroot/yunyao/public/index.php
FCGI_ROLE
RESPONDER
PHP_SELF
/index.php
REQUEST_TIME_FLOAT
1716193697.9486
REQUEST_TIME
1716193697
Environment Variablesempty
ThinkPHP Constants
APP_PATH
/www/wwwroot/yunyao/public/../application/
ADMINIMG
/www/wwwroot/yunyao/public/../public/static/admin/uploads/cateimg/
ADMIN_STATIC
/www/wwwroot/yunyao/public/../public/static/admin/
INDEXIMG
/www/wwwroot/yunyao/public/../public/static/index/uploads/img/
INDEXATT
/www/wwwroot/yunyao/public/../public/static/index/uploads/att/
INDEXAD
/www/wwwroot/yunyao/public/../public/static/index/ad/
TEM_SRC
../template/
THINK_VERSION
5.0.6
THINK_START_TIME
1716193697.949
THINK_START_MEM
376808
EXT
.php
DS
/
THINK_PATH
/www/wwwroot/yunyao/thinkphp/
LIB_PATH
/www/wwwroot/yunyao/thinkphp/library/
CORE_PATH
/www/wwwroot/yunyao/thinkphp/library/think/
TRAIT_PATH
/www/wwwroot/yunyao/thinkphp/library/traits/
ROOT_PATH
/www/wwwroot/yunyao/
EXTEND_PATH
/www/wwwroot/yunyao/extend/
VENDOR_PATH
/www/wwwroot/yunyao/vendor/
RUNTIME_PATH
/www/wwwroot/yunyao/runtime/
LOG_PATH
/www/wwwroot/yunyao/runtime/log/
CACHE_PATH
/www/wwwroot/yunyao/runtime/cache/
TEMP_PATH
/www/wwwroot/yunyao/runtime/temp/
CONF_PATH
/www/wwwroot/yunyao/public/../application/
CONF_EXT
.php
ENV_PREFIX
PHP_
IS_CLI
false
IS_WIN
false
0.055297s