Core.php 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <?php
  2. namespace Video\Lib;
  3. use Dever;
  4. class Core
  5. {
  6. public function vod_api()
  7. {
  8. $data['name'] = '视频';
  9. $where = array();
  10. $name = Dever::input('search_name');
  11. $cate = Dever::input('search_cate');
  12. if ($name) {
  13. $where['name'] = $name;
  14. }
  15. if ($cate > 0) {
  16. $where['cate_id'] = $cate;
  17. }
  18. $data['file'] = Dever::db('video/vod')->list($where);
  19. $data['cate'] = Dever::db('content/cate')->getAll();
  20. if ($data['file']) {
  21. foreach ($data['file'] as $k => $v) {
  22. $data['file'][$k]['source_name'] = $v['name'];
  23. $data['file'][$k]['file'] = $v['pic_cover'];
  24. $data['file'][$k]['pic'] = $v['pic_cover'];
  25. }
  26. }
  27. return $data;
  28. }
  29. public function live_api()
  30. {
  31. $data['name'] = '直播';
  32. $where = array();
  33. $name = Dever::input('search_name');
  34. $cate = Dever::input('search_cate');
  35. if ($name) {
  36. $where['name'] = $name;
  37. }
  38. if ($cate > 0) {
  39. $where['cate_id'] = $cate;
  40. }
  41. $data['file'] = Dever::db('video/live')->list($where);
  42. $data['cate'] = Dever::db('content/cate')->getAll();
  43. if ($data['file']) {
  44. foreach ($data['file'] as $k => $v) {
  45. $data['file'][$k]['source_name'] = $v['name'];
  46. $data['file'][$k]['file'] = $v['pic_cover'];
  47. $data['file'][$k]['pic'] = $v['pic_cover'];
  48. }
  49. }
  50. return $data;
  51. }
  52. }