PHP warning

Invalid argument supplied for foreach()

/home/wwwroot/adopt/web/protected/views/product/detail.php(21)

09     </div>
10 </div>
11 <!-- e =nowSite -->
12 
13 <!--详情页面 -->
14 <div class="petDetail">
15     <div class="container clr">
16         <div class="petDetail-hd">
17             <div class="hd-left">
18                 <div class="scroll">
19                     <div class="bigPic">
20                         <ul>
21                             <?php foreach($product['pic'] as $pic){?>
22                             <li>
23                                 <img width="386" height="270" src="<?php echo $pic['filename'].'?imageMogr2/thumbnail/!386x270r/gravity/Center/crop/386x270/quality/80';?>"/>
24                             </li>
25                             <?php }?>
26                         </ul>
27                     </div>
28                     <div class="smallPic">
29                         <ul>
30                             <?php foreach($product['pic'] as $pic){?>
31                                 <li>
32                                     <img width="123" height="85" src="<?php echo $pic['filename'].'?imageMogr2/thumbnail/!123x85r/gravity/Center/crop/123x85/quality/80';?>"/>
33                                 </li>

Stack Trace

#4
+
 /home/wwwroot/adopt/web/protected/components/Controller.php(82): CController->render("detail", array("product" => array(), "productRel" => array(array("id" => "660", "sex" => "母", "name" => "花魁 母", "cat_dog" => "猫", ...), array("id" => "717", "sex" => "公", "name" => "五百 公", "cat_dog" => "狗", ...))), false)
77         }
78 
79         if ($return) {
80             return parent::render($view, $data, $return);
81         } else {
82             parent::render($view, $data, $return);
83         }
84     }
85 
86     //常规跳转页面
87     public function customRedirect($message, $url = '', $time = 3, $is_get = false)
#5
+
 /home/wwwroot/adopt/web/protected/controllers/ProductController.php(62): Controller->render("detail", array("product" => array(), "productRel" => array(array("id" => "660", "sex" => "母", "name" => "花魁 母", "cat_dog" => "猫", ...), array("id" => "717", "sex" => "公", "name" => "五百 公", "cat_dog" => "狗", ...))))
57         //获取未领养宠物信息
58         $productRel = Product::getRandFromProduct(0,2,Product::ADOPTION_NO,$language);
59 
60         $this->render('detail',array(
61             'product' => $productInfo,
62             'productRel' => $productRel,
63         ));
64 
65     }
66 
67 
#13
+
 /home/wwwroot/adopt/web/public/index.php(34): CApplication->run()
29 ini_set('session.name', 'PHPSESSID');
30 ini_set('date.timezone', 'Asia/Shanghai');
31 
32 include SERVER_ROOT.'framework/YiiBase.php';
33 require SERVER_ROOT.'protected/extensions/yii.php';
34 Yii::createWebApplication($config)->run();
2024-03-19 19:20:58 nginx/1.14.2 Yii Framework/1.1.14