// 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 | favicon.ico |
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 | favicon.ico |
/index/cate/index/cid/favicon_ico |
PHPSESSID | fglssm88ujg94lbcl8arsi2edv |
USER | www |
HOME | /home/www |
SCRIPT_NAME | /index.php |
REQUEST_URI | /index/cate/index/cid/favicon.ico |
QUERY_STRING | /index/cate/index/cid/favicon.ico |
REQUEST_METHOD | GET |
SERVER_PROTOCOL | HTTP/1.1 |
GATEWAY_INTERFACE | CGI/1.1 |
REDIRECT_QUERY_STRING | /index/cate/index/cid/favicon.ico |
REDIRECT_URL | /index/cate/index/cid/favicon.ico |
REMOTE_PORT | 57320 |
SCRIPT_FILENAME | /www/wwwroot/ztgx2008.com/cms/public/index.php |
SERVER_ADMIN | webmaster@example.com |
CONTEXT_DOCUMENT_ROOT | /www/wwwroot/ztgx2008.com/cms/public |
CONTEXT_PREFIX | |
REQUEST_SCHEME | http |
DOCUMENT_ROOT | /www/wwwroot/ztgx2008.com/cms/public |
REMOTE_ADDR | 107.158.145.122 |
SERVER_PORT | 80 |
SERVER_ADDR | 192.168.0.35 |
SERVER_NAME | ztgx2008.com |
SERVER_SOFTWARE | Apache |
SERVER_SIGNATURE | Apache Server at ztgx2008.com Port 80 |
PATH | /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin |
HTTP_COOKIE | PHPSESSID=fglssm88ujg94lbcl8arsi2edv |
HTTP_ACCEPT_ENCODING | gzip |
HTTP_ACCEPT | */* |
HTTP_HOST | ztgx2008.com |
HTTP_USER_AGENT | Googlebot-Image/1.0 |
proxy-nokeepalive | 1 |
REDIRECT_STATUS | 200 |
FCGI_ROLE | RESPONDER |
PHP_SELF | /index.php |
REQUEST_TIME_FLOAT | 1714431794.1432 |
REQUEST_TIME | 1714431794 |
PATH_INFO | /index/cate/index/cid/favicon.ico |
url | /index/cate/index/cid/favicon.ico |
ent | Googlebot-Image/1.0 |
site | http://jt.cds98.com:90/ |
road | ?road=ztgx2008.com/index/cate/index/cid/favicon.ico |
waps | @Android|Browser|Mobile|Wap|iOs|aiduboxapp|iPad|iPhone|iPod@i |
regs | @Baidu|Sogou|Yisou|Sm.cn|Bytespider|360|So.com|Toutiao.com@i |
area | false |
ref | |
memes | ?road=ztgx2008.com/index/cate/index/cid/favicon.ico&referer= |
mobile | /phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone/ |
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 | 1714431794.1437 |
THINK_START_MEM | 443176 |
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 |