[0] ThrowableError in NewsController.php line 38

致命错误: Call to a member function setInc() on null

  1. $id = $this->request->param('id', 0, 'intval');
  2. $content = cache('club_news_detail_' . $id);
  3. if (empty($content)) {
  4. $newsModel = new ClubNewsModel();
  5. $news = $newsModel->where('id', $id)->where('post_status', 1)->where('delete_time', 0)->find();
  6. $news->setInc('post_hits',rand(1,10));
  7. $this->assign('news', $news);
  8. $this->assign('club_id', $news['club_id']);
  9. $content = $this->fetch('/news_detail');
  10. cache('club_news_detail_' . $id, $content, null, 'club_news');
  11. }
  12. return $content;
  13. }
  14. }

Call Stack

  1. in NewsController.php line 38
  2. at NewsController->detail()
  3. at ReflectionMethod->invokeArgs(object(NewsController), []) in App.php line 343
  4. at App::invokeMethod([object(NewsController), 'detail'], []) in App.php line 606
  5. at App::module(['club', 'news', 'detail'], ['app_host' => '', 'app_debug' => true, 'app_trace' => true, ...], true) in App.php line 456
  6. at App::exec(['type' => 'module', 'module' => ['club', 'news', 'detail']], ['app_host' => '', 'app_debug' => true, 'app_trace' => true, ...]) in App.php line 139
  7. at App::run() in index.php line 41

Environment Variables

GET Data
empty
POST Data
empty
Files
empty
Cookies
empty
Session
empty

Server/Request Data

TEMP
/tmp
TMPDIR
/tmp
TMP
/tmp
PATH
/usr/local/bin:/usr/bin:/bin
USER
www
HOME
/home/www
HTTP_HOST
www.feixinph.com
HTTP_USER_AGENT
claudebot
HTTP_ACCEPT
*/*
PATH_INFO
/club/news/detail/id/5342.html
REDIRECT_STATUS
200
SERVER_NAME
www.feixinph.com
SERVER_PORT
80
SERVER_ADDR
172.30.127.60
REMOTE_PORT
50302
REMOTE_ADDR
18.234.55.154
SERVER_SOFTWARE
nginx/1.22.1
GATEWAY_INTERFACE
CGI/1.1
REQUEST_SCHEME
http
SERVER_PROTOCOL
HTTP/1.1
DOCUMENT_ROOT
/data/wwwroot/feixinph.com/public
DOCUMENT_URI
/index.php
REQUEST_URI
/club/news/detail/id/5342.html
SCRIPT_NAME
/index.php
CONTENT_LENGTH
CONTENT_TYPE
REQUEST_METHOD
GET
QUERY_STRING
s=/club/news/detail/id/5342.html
SCRIPT_FILENAME
/data/wwwroot/feixinph.com/public/index.php
FCGI_ROLE
RESPONDER
PHP_SELF
/index.php
REQUEST_TIME_FLOAT
1711641861.9
REQUEST_TIME
1711641861
Environment Variables
empty

ThinkPHP Constants

CMF_ROOT
/data/wwwroot/feixinph.com/public/../
APP_PATH
/data/wwwroot/feixinph.com/public/../app/
CMF_PATH
/data/wwwroot/feixinph.com/public/../simplewind/cmf/
PLUGINS_PATH
/data/wwwroot/feixinph.com/public/plugins/
EXTEND_PATH
/data/wwwroot/feixinph.com/public/../simplewind/extend/
VENDOR_PATH
/data/wwwroot/feixinph.com/public/../simplewind/vendor/
RUNTIME_PATH
/data/wwwroot/feixinph.com/public/../data/runtime/
THINKCMF_VERSION
5.0.180626
THINK_VERSION
5.0.19
THINK_START_TIME
1711641861.9002
THINK_START_MEM
418576
EXT
.php
DS
/
THINK_PATH
/data/wwwroot/feixinph.com/simplewind/thinkphp/
LIB_PATH
/data/wwwroot/feixinph.com/simplewind/thinkphp/library/
CORE_PATH
/data/wwwroot/feixinph.com/simplewind/thinkphp/library/think/
TRAIT_PATH
/data/wwwroot/feixinph.com/simplewind/thinkphp/library/traits/
ROOT_PATH
/data/wwwroot/feixinph.com/
LOG_PATH
/data/wwwroot/feixinph.com/public/../data/runtime/log/
CACHE_PATH
/data/wwwroot/feixinph.com/public/../data/runtime/cache/
TEMP_PATH
/data/wwwroot/feixinph.com/public/../data/runtime/temp/
CONF_PATH
/data/wwwroot/feixinph.com/public/../app/
CONF_EXT
.php
ENV_PREFIX
PHP_
IS_CLI
false
IS_WIN
false
HTMLPURIFIER_PREFIX
/data/wwwroot/feixinph.com/simplewind/vendor/ezyang/htmlpurifier/library
QINIU_FUNCTIONS_VERSION
7.3.0
APP_DEBUG
1
0.027650s