[2] ErrorException in WenchuangController.php line 457

Invalid argument supplied for foreach()

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

Call Stack

  1. in WenchuangController.php line 457
  2. at Error::appError(2, 'Invalid argument sup...', '/home/wwwroot/zhongh...', 457, ['title' => [['id' => 197, 'name' => '资讯'], ['id' => 198, 'name' => '推荐'], ['id' => 199, 'name' => '清单'], ...], 'p_id' => '199', 'id' => '9', ...]) in WenchuangController.php line 457
  3. at WenchuangController->detail()
  4. at ReflectionMethod->invokeArgs(object(WenchuangController), []) in Container.php line 395
  5. at Container->invokeReflectMethod(object(WenchuangController), object(ReflectionMethod), ['id' => '9', 'type' => '3', 'p_id' => '199']) 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 9
type 3
p_id 199
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/wenchuang/detail.html&id=9&&type=3&&p_id=199
REQUEST_METHOD GET
CONTENT_TYPE
CONTENT_LENGTH
SCRIPT_NAME /index.php
REQUEST_URI /api/wenchuang/detail.html?id=9&&type=3&&p_id=199
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 54.234.124.70
REMOTE_PORT 54580
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 1711691039.6042
REQUEST_TIME 1711691039
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.135432s