[0] ThrowableError in Answer.php line 53

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

  1. public function detail($id=0){
  2. $data = model("Answer")->find($id);
  3. $name=model('column')->where('id',"{$data['cid']}")->find();
  4. $dat=model('Answer')->order('view desc')->limit(5)->select();
  5. $this->assign('dat',$dat);
  6. $dat2=model('Answer')->order('create_time desc')->limit(5)->select();
  7. $this->assign('dat2',$dat2);
  8. // 数据加1
  9. $data->setInc('view');
  10. $this->assign('data',$data);
  11. $this->assign('name',$name);
  12. return $this->fetch(); // 渲染模板
  13. }

Call Stack

  1. in Answer.php line 53
  2. at Answer->detail('1029')
  3. at ReflectionMethod->invokeArgs(object(Answer), ['1029']) in Container.php line 395
  4. at Container->invokeReflectMethod(object(Answer), object(ReflectionMethod), ['id' => '1029', 'cid' => '100002']) in Module.php line 131
  5. at Module->think\route\dispatch\{closure}(object(Request), object(Closure), null)
  6. at call_user_func_array(object(Closure), [object(Request), object(Closure), null]) in Middleware.php line 185
  7. at Middleware->think\{closure}(object(Request))
  8. at call_user_func(object(Closure), object(Request)) in Middleware.php line 130
  9. at Middleware->dispatch(object(Request), 'controller') in Module.php line 136
  10. at Module->exec() in Dispatch.php line 168
  11. at Dispatch->run() in App.php line 432
  12. at App->think\{closure}(object(Request), object(Closure), null)
  13. at call_user_func_array(object(Closure), [object(Request), object(Closure), null]) in Middleware.php line 185
  14. at Middleware->think\{closure}(object(Request))
  15. at call_user_func(object(Closure), object(Request)) in Middleware.php line 130
  16. at Middleware->dispatch(object(Request)) in App.php line 435
  17. at App->run() in index.php line 25

Environment Variables

GET Dataempty
POST Dataempty
Filesempty
Cookiesempty
Sessionempty
Server/Request Data
USER www
HOME /home/www
HTTP_HOST www.zhijie-edu.com
HTTP_USER_AGENT claudebot
HTTP_ACCEPT */*
PATH_INFO
REDIRECT_STATUS 200
SERVER_NAME www.zhijie-edu.com
SERVER_PORT 80
SERVER_ADDR 192.168.1.35
REMOTE_PORT 56516
REMOTE_ADDR 44.222.186.148
SERVER_SOFTWARE nginx/1.19.2
GATEWAY_INTERFACE CGI/1.1
REQUEST_SCHEME http
SERVER_PROTOCOL HTTP/1.1
DOCUMENT_ROOT /www/wwwroot/hmf.dajiankangedu.com/public
DOCUMENT_URI /index.php
REQUEST_URI /web/answer/detail/id/1029/cid/100002.html
SCRIPT_NAME /index.php
CONTENT_LENGTH
CONTENT_TYPE
REQUEST_METHOD GET
QUERY_STRING s=/web/answer/detail/id/1029/cid/100002.html
SCRIPT_FILENAME /www/wwwroot/hmf.dajiankangedu.com/public/index.php
FCGI_ROLE RESPONDER
PHP_SELF /index.php
REQUEST_TIME_FLOAT 1711697818.4116
REQUEST_TIME 1711697818
Environment Variablesempty
ThinkPHP Constants
ADMIN_FILE admin.php
SR_KEY YB19Mjk5hVhFX9Rt
FILTER_VALIDATE_BOOL 258
HTMLPURIFIER_PREFIX /www/wwwroot/hmf.dajiankangedu.com/vendor/ezyang/htmlpurifier/library
PUBLIC_PATH /