联系官方销售客服
1835022288
028-61286886
批量获取视频模块的内容,分集的内容,分集和视频列表一起获取
用到的接口:http://v3.xunruicms.com/help/231.html
1 创建自定义函数,在my_helper.php中增加
function dr_usu_list_video($dir, $limit) { $ci = &get_instance(); $query = $ci->db->from($ci->db->dbprefix(SITE_ID.'_'.$dir).' AS a') ->join($ci->db->dbprefix(SITE_ID.'_'.$dir.'_data_0').' AS b', 'a.id=b.id', 'left') ->limit($limit) ->get(); if (!$query) { return NULL; } $data = $query->result_array(); if (!$data) { return NULL; } $rt = array(); foreach ($data as $i => $r) { // 分集查询 $fenji = array(); $extend = $ci->db->from($ci->db->dbprefix(SITE_ID.'_'.$dir.'_extend').' AS a') ->join($ci->db->dbprefix(SITE_ID.'_'.$dir.'_extend_data_0').' AS b', 'a.id=b.id', 'left') ->where('a.cid', $r['id']) ->limit($limit) ->get()->result_array(); if ($extend) { foreach($extend as $t) { $video = dr_string2array($t['video']); $fenji[] = array( 'id' => $t['id'], 'name' => $t['name'], 'video' => dr_get_file($video['file']), 'body' => htmlspecialchars($t['body']), ); } } $rt[] = array( 'id' => $r['id'], 'title' => $r['title'], 'thumb' => dr_get_file($r['thumb']), 'content' => htmlspecialchars($r['content']), 'fenji' => $fenji, ); } return $rt; }
2 请求数据
/index.php?c=api&m=data2&auth=授权认证码¶m=function&name=dr_usu_list_video&p1=video&p2=1000
这里授权码是移动端授权码的md5值
--------------------
长期接POSCMS、FineCMS5插件和功能开发,网站界面设计
本人小店 http://www.xunruicms.com/shop/dever/4310.html
火爆插件:阿里短信接口、注册验证码、友情链接、推荐位、表单查询、点赞等插件低至10元起,一次购买终身可下载。
只要你想的到的功能,我都可以给你开发好!