Пример #1
0
 /**
  * 解析首页演讲集数据
  *
  * @param string $data 演讲集数据
  *  - DataFormat: JSON-String
  *  - Description: 具有演讲集ID集合的JSON格式的字符串
  *  - Example: '[1,2,3,4,6]'
  * @return mixed
  *  - null 数据不符合JSON格式
  *  - array
  *  [
  *      {
  *          'id' => '演讲集ID',
  *          'title' => '演讲集标题',
  *          'img' => '演讲集封面图片URL',
  *      },
  *      .........
  *  ]
  */
 protected function _parseMainPageSpeeches($data)
 {
     $result = [];
     $data = json_decode($data, true);
     if ($data) {
         $result = Speech::getByIds($data);
     }
     return $result;
 }