#0 [0]TypeError in Cms.php line 57

Argument 2 passed to app\common\service\Cms::addHits() must be of the type string, null given

  1. return $cate;
  2. }
  3. /**
  4. * 更新内容的点击数
  5. * @param string $id 内容id
  6. * @param string $tableName 表名称(含前缀)
  7. * @return bool
  8. */
  9. public function addHits(string $id, string $tableName)
  10. {
  11. // 判断当前表是否存在hits字段
  12. if ($this->_iset_field(Config::get('database.connections.mysql.prefix') . $tableName, 'hits')) {
  13. Db::name($tableName)
  14. ->where('id', $id)
  15. ->inc('hits')
  16. ->update();
  17. return true;
  18. }

Call Stack

  1. in Cms.php line 57
  2. at Cms->addHits()
  3. at call_user_func_array() in Facade.php line 96
  4. at Facade::__callStatic() in Error.php line 104
  5. at Error->info()
  6. at ReflectionMethod->invokeArgs() in Container.php line 343
  7. at Container->invokeReflectMethod() in Controller.php line 110
  8. at Controller->think\route\dispatch\{closure}() in Pipeline.php line 59
  9. at Pipeline->think\{closure}() in Pipeline.php line 66
  10. at Pipeline->then() in Controller.php line 113
  11. at Controller->exec() in Dispatch.php line 89
  12. at Dispatch->run() in Route.php line 772
  13. at Route->think\{closure}() in Pipeline.php line 59
  14. at Pipeline->think\{closure}() in Pipeline.php line 66
  15. at Pipeline->then() in Route.php line 773
  16. at Route->dispatch() in Http.php line 216
  17. at Http->dispatchToRoute() in Http.php line 206
  18. at Http->think\{closure}() in Pipeline.php line 59
  19. at Pipeline->think\{closure}() in MultiApp.php line 71
  20. at MultiApp->think\app\{closure}() in Pipeline.php line 59
  21. at Pipeline->think\{closure}() in Pipeline.php line 66
  22. at Pipeline->then() in MultiApp.php line 72
  23. at MultiApp->handle()
  24. at call_user_func() in Middleware.php line 142
  25. at Middleware->think\{closure}() in Pipeline.php line 85
  26. at Pipeline->think\{closure}() in SessionInit.php line 67
  27. at SessionInit->handle()
  28. at call_user_func() in Middleware.php line 142
  29. at Middleware->think\{closure}() in Pipeline.php line 85
  30. at Pipeline->think\{closure}() in TraceDebug.php line 71
  31. at TraceDebug->handle()
  32. at call_user_func() in Middleware.php line 142
  33. at Middleware->think\{closure}() in Pipeline.php line 85
  34. at Pipeline->think\{closure}() in Pipeline.php line 66
  35. at Pipeline->then() in Http.php line 207
  36. at Http->runWithRequest() in Http.php line 170
  37. at Http->run() in index.php line 25

Environment Variables

GET Data
cate 16
id 180
POST Dataempty
Filesempty
Cookiesempty
Sessionempty
Server/Request Data
USER www
HOME /home/www
PATH_TRANSLATED /www/wwwroot/SIYUCMS/public//index/Article/info.html
ORIG_SCRIPT_FILENAME /www/wwwroot/SIYUCMS/public/index.php//index/Article/info.html
HTTP_HOST ldhly.com
HTTP_USER_AGENT claudebot
HTTP_ACCEPT */*
REDIRECT_STATUS 200
SERVER_NAME siyu.ldhly.com
SERVER_PORT 80
SERVER_ADDR 172.17.168.88
REMOTE_PORT 42986
REMOTE_ADDR 35.173.178.60
SERVER_SOFTWARE nginx/1.17.10
GATEWAY_INTERFACE CGI/1.1
REQUEST_SCHEME http
SERVER_PROTOCOL HTTP/1.1
DOCUMENT_ROOT /www/wwwroot/SIYUCMS/public
DOCUMENT_URI /index.php//index/Article/info.html
REQUEST_URI /index/Article/info.html?cate=16&id=180
CONTENT_LENGTH
CONTENT_TYPE
REQUEST_METHOD GET
QUERY_STRING cate=16&id=180
SCRIPT_NAME /index.php//index/Article/info.html
SCRIPT_FILENAME /www/wwwroot/SIYUCMS/public/index.php
PATH_INFO //index/Article/info.html
FCGI_ROLE RESPONDER
PHP_SELF /index.php//index/Article/info.html//index/Article/info.html
REQUEST_TIME_FLOAT 1711659510.5503
REQUEST_TIME 1711659510