Vod.php 880 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. namespace Video\Lib;
  3. use Dever;
  4. class Vod
  5. {
  6. # 根据id 获取信息
  7. public function get($data, $uid = false)
  8. {
  9. if (!is_array($data)) {
  10. $data = Dever::db('video/vod')->getOne($data);
  11. }
  12. if (!$data) {
  13. Dever::alert('错误的信息');
  14. }
  15. $data['content'] = Dever::filter($data['content']);
  16. $data['video'] = convert($data['video'], 'mp4', 'video/vod', $data['id'], 'video');
  17. return $data;
  18. }
  19. # 获取相关推荐
  20. public function getRelation($info)
  21. {
  22. $where['noid'] = $info['id'];
  23. $where['cate_id'] = $info['cate_id'];
  24. return Dever::db('video/vod')->getRelation($where);
  25. }
  26. # 增加浏览量
  27. public function addView($id)
  28. {
  29. Dever::db('video/vod')->addView($id);
  30. }
  31. }