[0] ThrowableError in NewsController.php line 46

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

  1. 'm_page' => $m_data->render(),
  2. 'banner'=>$this->banner
  3. ]);
  4. return $this->fetch();
  5. }
  6. public function newsDetail($id, GuNews $model)
  7. {
  8. $data = $model::get(['id' => $id,'status'=>1]);
  9. $data->setInc('uv');
  10. $this->assign([
  11. 'data' => $data,
  12. 'banner'=>$this->banner
  13. ]);
  14. return $this->fetch();
  15. }
  16. }

Call Stack

  1. in NewsController.php line 46
  2. at NewsController->newsDetail('Line', object(GuNews))
  3. at ReflectionMethod->invokeArgs(object(NewsController), ['Line', object(GuNews)]) in Container.php line 395
  4. at Container->invokeReflectMethod(object(NewsController), object(ReflectionMethod), ['id' => 'Line', 'convert' => false]) 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 23

Environment Variables

GET Dataempty
POST Dataempty
Filesempty
Cookiesempty
Sessionempty
Server/Request Data
USER nobody
HOME /
HTTP_HOST ast-eurojoy.com
HTTP_USER_AGENT claudebot
HTTP_ACCEPT */*
REDIRECT_STATUS 200
SERVER_NAME wh-nbj2im0ca5i9lu2yvqz.my3w.com
SERVER_PORT 80
SERVER_ADDR 172.21.51.164
REMOTE_PORT 33272
REMOTE_ADDR 44.220.245.254
SERVER_SOFTWARE nginx/1.18.0
GATEWAY_INTERFACE CGI/1.1
REQUEST_SCHEME http
SERVER_PROTOCOL HTTP/1.1
DOCUMENT_ROOT /data/user/htdocs
DOCUMENT_URI /index.php
REQUEST_URI /newsdetail/Line
SCRIPT_NAME /index.php
CONTENT_LENGTH
CONTENT_TYPE
REQUEST_METHOD GET
QUERY_STRING s=/newsdetail/Line
PATH_INFO
SCRIPT_FILENAME /data/user/htdocs/index.php
FCGI_ROLE RESPONDER
PHP_SELF /index.php
REQUEST_TIME_FLOAT 1710849175.0251
REQUEST_TIME 1710849175
Environment Variablesempty
ThinkPHP Constants
URL_CURRENT url://current
URL_RELOAD url://reload
URL_BACK url://back