[2] ErrorException in Index.php line 145

Invalid argument supplied for foreach()

  1. } else if ($top_cate == 45) {
  2. header('Location:' . url('public_special', ['cate' => $cate]));
  3. exit();
  4. }
  5. $top_cate_info = HomeModel::getNavigateInfo(['id' => $top_cate], ['name', 'id']);
  6. $all_parent = HomeModel::getAllParents($cate_info['id']);
  7. $center_menu = HomeModel::getCategoryTree($top_cate, ['name', 'id'], $all_parent);
  8. $size = $cate_info['page_size'];
  9. $news_list = HomeModel::getArticle(['category' => $cate_info['id']], ['title', 'thumb', 'source', 'author', 'click', 'created_at', 'abstract'], true, $size);
  10. foreach ($news_list['list'] as $k => $list) {
  11. $news_list['list'][$k]['thumb'] = $list['thumb'] ? str_replace('\\', '/', $list['thumb']) : ($cate_info['tpl'] != 'news_other' ? '/home/images/default.jpg' : '');
  12. $news_list['list'][$k]['created_at'] = date('Y-m-d', strtotime($list['created_at']));
  13. }
  14. $position = HomeModel::position($cate_info['id']);
  15. if (in_array($cate, [134, 138])) {
  16. $this->assign('guidang', true);
  17. }
  18. return $this->fetch(HOME_VIEW_PATH . ($cate_info['tpl'] ?: 'news_text_list') . '.html', [
  19. 'top_cate_info' => $top_cate_info,

Call Stack

  1. in Index.php line 145
  2. at Error::appError(2, 'Invalid argument sup...', '/d/www/qjfy.gov.cn/a...', 145, ['cate' => '143', 'cate_info' => null, 'top_cate' => null, ...]) in Index.php line 145
  3. at Index->news_list()
  4. at ReflectionMethod->invokeArgs(object(Index), []) in Container.php line 395
  5. at Container->invokeReflectMethod(object(Index), object(ReflectionMethod), ['cate' => '143', '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 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.qjfy.gov.cn
PATH_INFO
REDIRECT_STATUS 200
SERVER_NAME qjfy.gov.cn
SERVER_PORT 443
SERVER_ADDR 192.168.0.193
REMOTE_PORT 52368
REMOTE_ADDR 3.81.165.210
SERVER_SOFTWARE nginx/1.22.1
GATEWAY_INTERFACE CGI/1.1
HTTPS on
REQUEST_SCHEME https
SERVER_PROTOCOL HTTP/2.0
DOCUMENT_ROOT /d/www/qjfy.gov.cn/public
DOCUMENT_URI /index.php
REQUEST_URI /article/list/143.html
SCRIPT_NAME /index.php
CONTENT_LENGTH
CONTENT_TYPE
REQUEST_METHOD GET
QUERY_STRING s=/article/list/143.html
SCRIPT_FILENAME /d/www/qjfy.gov.cn/public/index.php
FCGI_ROLE RESPONDER
PHP_SELF /index.php
REQUEST_TIME_FLOAT 1711709209.0626
REQUEST_TIME 1711709209
Environment Variablesempty
ThinkPHP Constants
ADMIN_CONTROLLER_PATH ch_admin_manage/
ADMIN_VIEW_PATH admin/
API_CONTROLLER_PATH api/
HOME_CONTROLLER_PATH home/
HOME_VIEW_PATH home/
UPLOAD_PATH /d/www/qjfy.gov.cn/public/uploads/