[8] ErrorException in Category.php line 65

未定义数组索引:

  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,58);

Call Stack

  1. in Category.php line 65
  2. at Error::appError(8, 'Undefined index: ', '/data/wwwroot/longqi...', 65, ['cid' => null, 'data' => [['id' => 1, 'pid' => 0], ['id' => 2, 'pid' => 36], ['id' => 3, 'pid' => 1], ...], 'arr' => [0, 36, 1, ...], ...]) in Category.php line 65
  3. at Category->getTopId(null) in Content.php line 31
  4. at Content->index('435')
  5. at ReflectionMethod->invokeArgs(object(Content), ['435']) in App.php line 343
  6. at App::invokeMethod([object(Content), 'index'], []) in App.php line 611
  7. at App::module(['index', 'Content', 'index'], ['app_host' => '', 'app_debug' => true, 'app_trace' => false, ...], false) in App.php line 457
  8. at App::exec(['type' => 'module', 'module' => ['index', 'Content', 'index'], 'convert' => false], ['app_host' => '', 'app_debug' => true, 'app_trace' => false, ...]) in App.php line 139
  9. at App::run() in start.php line 19
  10. at require('/data/wwwroot/longqi...') in index.php line 17

Environment Variables

GET Data
empty
POST Data
empty
Files
empty
Cookies
empty

Session

zy
{ "cityname": "\u9655\u897f\u7701" }

Server/Request Data

USER
www
HOME
/home/www
FCGI_ROLE
RESPONDER
SCRIPT_FILENAME
/data/wwwroot/longqi/public/index.php
QUERY_STRING
s=/show/435.html
REQUEST_METHOD
GET
CONTENT_TYPE
CONTENT_LENGTH
SCRIPT_NAME
/index.php
REQUEST_URI
/show/435.html
DOCUMENT_URI
/index.php
DOCUMENT_ROOT
/data/wwwroot/longqi/public
SERVER_PROTOCOL
HTTP/1.1
REQUEST_SCHEME
http
GATEWAY_INTERFACE
CGI/1.1
SERVER_SOFTWARE
nginx/1.14.2
REMOTE_ADDR
156.238.44.110
REMOTE_PORT
20000
SERVER_ADDR
172.17.158.68
SERVER_PORT
80
SERVER_NAME
www.longqisport.com
REDIRECT_STATUS
200
PATH_INFO
/show/435.html
HTTP_USER_AGENT
Mozilla/5.0+(compatible;+Baiduspider/2.0;++http://www.baidu.com/search/spider.html)
HTTP_HOST
www.longqisport.com
HTTP_ACCEPT
*/*
HTTP_ACCEPT_ENCODING
deflate, gzip
PHP_SELF
/index.php
REQUEST_TIME_FLOAT
1623658177.5615
REQUEST_TIME
1623658177
Environment Variables
empty

ThinkPHP Constants

APP_PATH
/data/wwwroot/longqi/public/../application/
THINK_VERSION
5.0.24
THINK_START_TIME
1623658177.5624
THINK_START_MEM
260288
EXT
.php
DS
/
THINK_PATH
/data/wwwroot/longqi/thinkphp/
LIB_PATH
/data/wwwroot/longqi/thinkphp/library/
CORE_PATH
/data/wwwroot/longqi/thinkphp/library/think/
TRAIT_PATH
/data/wwwroot/longqi/thinkphp/library/traits/
ROOT_PATH
/data/wwwroot/longqi/
EXTEND_PATH
/data/wwwroot/longqi/extend/
VENDOR_PATH
/data/wwwroot/longqi/vendor/
RUNTIME_PATH
/data/wwwroot/longqi/runtime/
LOG_PATH
/data/wwwroot/longqi/runtime/log/
CACHE_PATH
/data/wwwroot/longqi/runtime/cache/
TEMP_PATH
/data/wwwroot/longqi/runtime/temp/
CONF_PATH
/data/wwwroot/longqi/public/../application/
CONF_EXT
.php
ENV_PREFIX
PHP_
IS_CLI
false
IS_WIN
false