if (empty($modelInfo)) {
$this->error('模型不存在!');
}
//更新点击量
Db::name($modelInfo['tablename'])->where('id', $id)->setInc('hits');
//内容所有字段
$ifcache = $this->cmsConfig['site_cache_time'] ? $this->cmsConfig['site_cache_time'] : false;
$info = $this->Cms_Model->getContent($modelid, ['catid' => $catid, 'id' => $id], true, '*', '', $ifcache);
if (!$info || ($info['status'] !== 1 && !\app\admin\service\User::instance()->isLogin())) {
throw new \think\Exception('内容不存在或未审核!', 404);
}
//内容分页
$paginator = strpos($info['content'], '[page]');
if ($paginator !== false) {
$contents = array_filter(explode('[page]', $info['content']));
$total = count($contents);
$pages = \app\cms\paginator\Page::make([], 1, $page, $total, false, ['path' => $this->request->baseUrl()]);
//判断[page]出现的位置是否在第一位
if ($paginator < 7) {
PHPSESSID | 8srle4vs30ffqb3vdf22q8gdq2 |
USER | www |
HOME | /home/www |
HTTP_COOKIE | PHPSESSID=8srle4vs30ffqb3vdf22q8gdq2 |
HTTP_ACCEPT_ENCODING | gzip |
HTTP_ACCEPT | */* |
HTTP_HOST | www.sz-tongye.com.cn |
HTTP_USER_AGENT | Mozilla/5.0 (compatible; MJ12bot/v1.4.8; http://mj12bot.com/) |
PATH_INFO | |
REDIRECT_STATUS | 200 |
SERVER_NAME | sz-tongye.com.cn |
SERVER_PORT | 80 |
SERVER_ADDR | 172.23.105.61 |
REMOTE_PORT | 59436 |
REMOTE_ADDR | 23.90.23.50 |
SERVER_SOFTWARE | nginx/1.20.2 |
GATEWAY_INTERFACE | CGI/1.1 |
REQUEST_SCHEME | http |
SERVER_PROTOCOL | HTTP/1.1 |
DOCUMENT_ROOT | /www/wwwroot/sz-tongye.com.cn |
DOCUMENT_URI | /index.php |
REQUEST_URI | /shows/16/27.html |
SCRIPT_NAME | /index.php |
CONTENT_LENGTH | |
CONTENT_TYPE | |
REQUEST_METHOD | GET |
QUERY_STRING | s=//shows/16/27.html |
SCRIPT_FILENAME | /www/wwwroot/sz-tongye.com.cn/index.php |
FCGI_ROLE | RESPONDER |
PHP_SELF | /index.php |
REQUEST_TIME_FLOAT | 1701163121.6247 |
REQUEST_TIME | 1701163121 |
ROOT_PATH | /www/wwwroot/sz-tongye.com.cn/ |
APP_PATH | /www/wwwroot/sz-tongye.com.cn/application/ |
DS | / |
ADDON_PATH | /www/wwwroot/sz-tongye.com.cn/addons/ |
ROOT_URL | / |
TEMPLATE_PATH | /www/wwwroot/sz-tongye.com.cn/templates/ |
PINYIN_DEFAULT | 4096 |
PINYIN_TONE | 2 |
PINYIN_NO_TONE | 4 |
PINYIN_ASCII_TONE | 8 |
PINYIN_NAME | 16 |
PINYIN_KEEP_NUMBER | 32 |
PINYIN_KEEP_ENGLISH | 64 |
PINYIN_UMLAUT_V | 128 |
PINYIN_KEEP_PUNCTUATION | 256 |