// 1 => 0,
// // 省略...
// 5 => 1,
// // 省略...
// 13 => 5
// ];
// 建议将这数组缓存起来
$id = $cid;
if($arr[$id]) {
$id = $arr[$id];
}
return $id; // 1
}
public function getPageContent($cid){
$cates=$this->field('content')->find($cid);
$content=strip_tags($cates['content']);
$content=cut_str($content,66);
cid | Resource |
data | [ { "id": 1, "pid": 0 }, { "id": 2, "pid": 1 }, { "id": 4, "pid": 1 }, { "id": 5, "pid": 0 }, { "id": 6, "pid": 5 }, { "id": 7, "pid": 5 }, { "id": 8, "pid": 0 }, { "id": 9, "pid": 8 }, { "id": 10, "pid": 8 }, { "id": 13, "pid": 0 }, { "id": 22, "pid": 13 }, { "id": 23, "pid": 8 }, { "id": 24, "pid": 8 }, { "id": 25, "pid": 8 }, { "id": 26, "pid": 8 }, { "id": 27, "pid": 8 }, { "id": 32, "pid": 1 } ] |
arr | { "1": 0, "2": 1, "4": 1, "5": 0, "6": 5, "7": 5, "8": 0, "9": 8, "10": 8, "13": 0, "22": 13, "23": 8, "24": 8, "25": 8, "26": 8, "27": 8, "32": 1 } |
v | { "id": 32, "pid": 1 } |
k | 16 |
id | Resource |
PHPSESSID | kbrdjptg93pr8an6q10hr4robf |
USER | www |
HOME | /home/www |
HTTP_COOKIE | PHPSESSID=kbrdjptg93pr8an6q10hr4robf |
HTTP_ACCEPT_ENCODING | gzip |
HTTP_ACCEPT | */* |
HTTP_HOST | ztgx2008.com |
HTTP_USER_AGENT | Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com) |
PATH_INFO | /index/article/index/aid/favicon.ico |
REDIRECT_STATUS | 200 |
SERVER_NAME | ztgx2008.com |
SERVER_PORT | 80 |
SERVER_ADDR | 192.168.0.35 |
REMOTE_PORT | 54292 |
REMOTE_ADDR | 107.158.145.122 |
SERVER_SOFTWARE | nginx/1.21.4 |
GATEWAY_INTERFACE | CGI/1.1 |
REQUEST_SCHEME | http |
SERVER_PROTOCOL | HTTP/1.1 |
DOCUMENT_ROOT | /www/wwwroot/ztgx2008.com/cms/public |
DOCUMENT_URI | /index.php |
REQUEST_URI | /index/article/index/aid/favicon.ico |
SCRIPT_NAME | /index.php |
CONTENT_LENGTH | |
CONTENT_TYPE | |
REQUEST_METHOD | GET |
QUERY_STRING | s=/index/article/index/aid/favicon.ico |
SCRIPT_FILENAME | /www/wwwroot/ztgx2008.com/cms/public/index.php |
FCGI_ROLE | RESPONDER |
PHP_SELF | /index.php |
REQUEST_TIME_FLOAT | 1715662322.4317 |
REQUEST_TIME | 1715662322 |
APP_PATH | /www/wwwroot/ztgx2008.com/cms/public/../application/ |
ADMINIMG | /www/wwwroot/ztgx2008.com/cms/public/public/static/admin/uploads/cateimg/ |
ADMIN_STATIC | /www/wwwroot/ztgx2008.com/cms/public/static/admin/ |
INDEXIMG | /www/wwwroot/ztgx2008.com/cms/public/static/index/uploads/img/ |
INDEXATT | /www/wwwroot/ztgx2008.com/cms/public/static/index/uploads/att/ |
INDEXAD | /www/wwwroot/ztgx2008.com/cms/public/static/index/ad/ |
THINK_VERSION | 5.0.6 |
THINK_START_TIME | 1715662322.432 |
THINK_START_MEM | 421744 |
EXT | .php |
DS | / |
THINK_PATH | /www/wwwroot/ztgx2008.com/cms/thinkphp/ |
LIB_PATH | /www/wwwroot/ztgx2008.com/cms/thinkphp/library/ |
CORE_PATH | /www/wwwroot/ztgx2008.com/cms/thinkphp/library/think/ |
TRAIT_PATH | /www/wwwroot/ztgx2008.com/cms/thinkphp/library/traits/ |
ROOT_PATH | /www/wwwroot/ztgx2008.com/cms/ |
EXTEND_PATH | /www/wwwroot/ztgx2008.com/cms/extend/ |
VENDOR_PATH | /www/wwwroot/ztgx2008.com/cms/vendor/ |
RUNTIME_PATH | /www/wwwroot/ztgx2008.com/cms/runtime/ |
LOG_PATH | /www/wwwroot/ztgx2008.com/cms/runtime/log/ |
CACHE_PATH | /www/wwwroot/ztgx2008.com/cms/runtime/cache/ |
TEMP_PATH | /www/wwwroot/ztgx2008.com/cms/runtime/temp/ |
CONF_PATH | /www/wwwroot/ztgx2008.com/cms/public/../application/ |
CONF_EXT | .php |
ENV_PREFIX | PHP_ |
IS_CLI | false |
IS_WIN | false |