[8] ErrorException in News.php line 109

Trying to get property of non-object

  1. *
  2. */
  3. public function article(){
  4. $id = input("?id")?input("id/d"):"";
  5. if(empty($id)){
  6. return "";
  7. }
  8. //$arr = Db::name($this->dbName)->find($id); //下面使用model
  9. $arr = newsModel::get($id);
  10. $arr->hits = $arr->hits+1;
  11. $arr->save();
  12. //newsModel::hits($id);
  13. $this->preItem($id);
  14. $this->assign("news",$arr);
  15. $this->assign("arr",$arr);
  16. $this->assign("preNews",self::preItem($id));
  17. $this->assign("nextNews",self::nextItem($id));
  18. $this->assign('current_name_cn',$arr['title_cn']);
  19. $this->assign('current_name_en',$arr['title_en']);

Call Stack

  1. in News.php line 109
  2. at Error::appError(8, 'Trying to get proper...', '/data/user/htdocs/ap...', 109, ['id' => 1471, 'arr' => null]) in News.php line 109
  3. at News->article()
  4. at ReflectionMethod->invokeArgs(object(News), []) in Container.php line 395
  5. at Container->invokeReflectMethod(object(News), object(ReflectionMethod), ['id' => '1471', 'convert' => false]) in Module.php line 131
  6. at Module->think\route\dispatch\{closure}(object(Request), object(Closure), null)
  7. at call_user_func_array(object(Closure), [object(Request), object(Closure), null]) in Middleware.php line 185
  8. at Middleware->think\{closure}(object(Request))
  9. at call_user_func(object(Closure), object(Request)) in Middleware.php line 130
  10. at Middleware->dispatch(object(Request), 'controller') in Module.php line 136
  11. at Module->exec() in Dispatch.php line 168
  12. at Dispatch->run() in App.php line 432
  13. at App->think\{closure}(object(Request), object(Closure), null)
  14. at call_user_func_array(object(Closure), [object(Request), object(Closure), null]) in Middleware.php line 185
  15. at Middleware->think\{closure}(object(Request))
  16. at call_user_func(object(Closure), object(Request)) in Middleware.php line 130
  17. at Middleware->dispatch(object(Request)) in App.php line 435
  18. at App->run() in index.php line 18

Environment Variables

GET Dataempty
POST Dataempty
Filesempty
Cookiesempty
Sessionempty
Server/Request Data
USER nobody
HOME /
HTTP_HOST cacheng.com
HTTP_USER_AGENT claudebot
HTTP_ACCEPT */*
REDIRECT_STATUS 200
SERVER_NAME wh-nx3um5eupfiz40butx4.my3w.com
SERVER_PORT 80
SERVER_ADDR 172.19.8.136
REMOTE_PORT 54636
REMOTE_ADDR 18.232.62.134
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 /article/1471.html
SCRIPT_NAME /index.php
CONTENT_LENGTH
CONTENT_TYPE
REQUEST_METHOD GET
QUERY_STRING s=/article/1471.html
PATH_INFO
SCRIPT_FILENAME /data/user/htdocs/index.php
FCGI_ROLE RESPONDER
PHP_SELF /index.php
REQUEST_TIME_FLOAT 1711726875.3173
REQUEST_TIME 1711726875
Environment Variablesempty
ThinkPHP Constants
APP_PATH /data/user/htdocs/app/