Authored by 周少峰

add notice

@@ -57,14 +57,9 @@ class IndexController extends AbstractAction @@ -57,14 +57,9 @@ class IndexController extends AbstractAction
57 } 57 }
58 $notice = array(); 58 $notice = array();
59 $data = IndexData::getNotice(); 59 $data = IndexData::getNotice();
60 - do {  
61 - if ($data['code'] != 200 || !isset($data['open']) || $data['open'] != 'Y' || !isset($data['open']) || empty($data['list'])) {  
62 - break;  
63 - }  
64 - foreach ($data['list'] as $key => $val) {  
65 -  
66 - }  
67 - } while(false); 60 + if (isset($data['code']) && $data['code'] === 200 && isset($data['data']['open']) && $data['data']['open'] == 'Y' && isset($data['data']['list']) && !empty($data['data']['list'])) {
  61 + $notice = $data['data']['list'];
  62 + }
68 $this->echoJson($notice); 63 $this->echoJson($notice);
69 } 64 }
70 65