[2] ErrorException in FeiyiController.php line 477

Invalid argument supplied for foreach()

  1. $this->assign('data',$res);
  2. return $this->fetch('Feiyi/tuijian_detail');
  3. }else if($type == 3){
  4. $where = ['status'=>0];
  5. $res = Db::name('heritage_lists')->where(['status'=>0,'id'=>$id])->find();
  6. $pro_one = json_decode($res['project_one'],true);
  7. $pro_two = json_decode($res['project_two'],true);
  8. $arr = [];
  9. $crr = [];
  10. foreach ($pro_one as $k=>$v){
  11. $arr[$k]['project_one'] = $v;
  12. $arr[$k]['project_two'] = $pro_two[$k];
  13. }
  14. Db::name('heritage_lists')->where(['id'=>$id])->setInc('clicks',1);
  15. $up = Db::name('heritage_lists')->where($where)->where('id','<',$id)->order('id DESC')->limit(1)->find();
  16. if($up !=false){
  17. $up['p_id'] = 194;
  18. }
  19. $down = Db::name('heritage_lists')->where($where)->where('id','>',$id)->order('id ASC')->limit(1)->find();

Call Stack

  1. in FeiyiController.php line 477
  2. at Error::appError(2, 'Invalid argument sup...', '/home/wwwroot/zhongh...', 477, ['title' => [['id' => 192, 'name' => '资讯'], ['id' => 193, 'name' => '推荐'], ['id' => 194, 'name' => '清单'], ...], 'p_id' => '194', 'id' => '2', ...]) in FeiyiController.php line 477
  3. at FeiyiController->detail()
  4. at ReflectionMethod->invokeArgs(object(FeiyiController), []) in Container.php line 395
  5. at Container->invokeReflectMethod(object(FeiyiController), object(ReflectionMethod), ['id' => '2', 'type' => '3', 'p_id' => '194']) in Module.php line 132
  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 137
  11. at Module->exec() in Dispatch.php line 168
  12. at Dispatch->run() in App.php line 484
  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 487
  18. at App->run() in index.php line 33

Environment Variables

GET Data
id 2
type 3
p_id 194
POST Dataempty
Filesempty
Cookiesempty
Sessionempty
Server/Request Data
USER www
HOME /home/www
FCGI_ROLE RESPONDER
SCRIPT_FILENAME /www/wwwroot/zhonghuameiwang.com/public/index.php
QUERY_STRING s=/api/feiyi/detail.html&id=2&&type=3&&p_id=194
REQUEST_METHOD GET
CONTENT_TYPE
CONTENT_LENGTH
SCRIPT_NAME /index.php
REQUEST_URI /api/feiyi/detail.html?id=2&&type=3&&p_id=194
DOCUMENT_URI /index.php
DOCUMENT_ROOT /www/wwwroot/zhonghuameiwang.com/public
SERVER_PROTOCOL HTTP/1.1
REQUEST_SCHEME http
GATEWAY_INTERFACE CGI/1.1
SERVER_SOFTWARE nginx/1.16.1
REMOTE_ADDR 3.235.243.45
REMOTE_PORT 39628
SERVER_ADDR 211.149.206.106
SERVER_PORT 80
SERVER_NAME zhonghuameiwang.com
REDIRECT_STATUS 200
PATH_INFO
HTTP_ACCEPT */*
HTTP_USER_AGENT claudebot
HTTP_HOST zhonghuameiwang.com
PHP_SELF /index.php
REQUEST_TIME_FLOAT 1711653050.0569
REQUEST_TIME 1711653050
Environment Variablesempty
ThinkPHP Constants
APP_DEBUG true
CMF_ROOT /home/wwwroot/zhonghuameiwang.com/
CMF_DATA /home/wwwroot/zhonghuameiwang.com/data/
APP_PATH /home/wwwroot/zhonghuameiwang.com/app/
WEB_ROOT /home/wwwroot/zhonghuameiwang.com/public/
HTMLPURIFIER_PREFIX /home/wwwroot/zhonghuameiwang.com/vendor/ezyang/htmlpurifier/library
0.141962s