[2] ErrorException in Article.php line 86

count(): Parameter must be an array or an object that implements Countable

  1. // }
  2. // dump(Cache('1'));
  3. $result = self::gongyong($result);
  4. return $result;
  5. }
  6. #前台-标签页文章列表
  7. public static function taglists($id){
  8. $tagname = Tag::where('tagname',$id)->cache(true,8640000)->find();
  9. if (count($tagname) == 0 ) {return;}
  10. $taga = Taga::where('tid',$tagname['tid'])->cache(true,8640000)->select();
  11. if (count($taga) == 0 ) {return;}
  12. #处理整合标签为where in格式
  13. $data = '';
  14. foreach ($taga as $key => $value) {
  15. $data .= $value['gid'].',';
  16. }
  17. $data = trim($data,",");
  18. #根据ID 查询文章

Call Stack

  1. in Article.php line 86
  2. at Error::appError(2, 'count(): Parameter m...', '/www/wwwroot/www.19a...', 86, ['id' => 'RAID', 'tagname' => object(Tag)])
  3. at count(object(Tag)) in Article.php line 86
  4. at Article::taglists('RAID') in Index.php line 79
  5. at Index->dataList()
  6. at ReflectionMethod->invokeArgs(object(Index), []) in Container.php line 395
  7. at Container->invokeReflectMethod(object(Index), object(ReflectionMethod), ['type' => 'tag', 'id' => 'RAID', 'convert' => false]) in Module.php line 131
  8. at Module->think\route\dispatch\{closure}(object(Request), object(Closure), null)
  9. at call_user_func_array(object(Closure), [object(Request), object(Closure), null]) in Middleware.php line 185
  10. at Middleware->think\{closure}(object(Request))
  11. at call_user_func(object(Closure), object(Request)) in Middleware.php line 130
  12. at Middleware->dispatch(object(Request), 'controller') in Module.php line 136
  13. at Module->exec() in Dispatch.php line 168
  14. at Dispatch->run() in App.php line 432
  15. at App->think\{closure}(object(Request), object(Closure), null)
  16. at call_user_func_array(object(Closure), [object(Request), object(Closure), null]) in Middleware.php line 185
  17. at Middleware->think\{closure}(object(Request))
  18. at call_user_func(object(Closure), object(Request)) in Middleware.php line 130
  19. at Middleware->dispatch(object(Request)) in App.php line 435
  20. at App->run() in index.php line 21

Environment Variables

GET Dataempty
POST Dataempty
Filesempty
Cookiesempty
Sessionempty
Server/Request Data
USER www
HOME /home/www
HTTP_USER_AGENT claudebot
HTTP_ACCEPT */*
HTTP_HOST www.19aq.com
PATH_INFO
REDIRECT_STATUS 200
SERVER_NAME www.19aq.com
SERVER_PORT 443
SERVER_ADDR 172.27.0.11
REMOTE_PORT 51074
REMOTE_ADDR 54.205.179.155
SERVER_SOFTWARE nginx/1.20.2
GATEWAY_INTERFACE CGI/1.1
HTTPS on
REQUEST_SCHEME https
SERVER_PROTOCOL HTTP/2.0
DOCUMENT_ROOT /www/wwwroot/www.19aq.com/public
DOCUMENT_URI /index.php
REQUEST_URI /tag-RAID.html
SCRIPT_NAME /index.php
CONTENT_LENGTH
CONTENT_TYPE
REQUEST_METHOD GET
QUERY_STRING s=/tag-RAID.html
SCRIPT_FILENAME /www/wwwroot/www.19aq.com/public/index.php
FCGI_ROLE RESPONDER
PHP_SELF /index.php
REQUEST_TIME_FLOAT 1710846134.4871
REQUEST_TIME 1710846134
Environment Variablesempty
ThinkPHP Constants
QINIU_FUNCTIONS_VERSION 7.2.7