12345678910111213141516171819202122232425262728293031323334353637383940 |
- <?php
- namespace Video\Lib;
- use Dever;
- class Vod
- {
- # 根据id 获取信息
- public function get($data, $uid = false)
- {
- if (!is_array($data)) {
- $data = Dever::db('video/vod')->getOne($data);
- }
-
- if (!$data) {
- Dever::alert('错误的信息');
- }
-
- $data['content'] = Dever::filter($data['content']);
- $data['video'] = convert($data['video'], 'mp4', 'video/vod', $data['id'], 'video');
- return $data;
- }
- # 获取相关推荐
- public function getRelation($info)
- {
- $where['noid'] = $info['id'];
- $where['cate_id'] = $info['cate_id'];
- return Dever::db('video/vod')->getRelation($where);
- }
- # 增加浏览量
- public function addView($id)
- {
- Dever::db('video/vod')->addView($id);
- }
- }
|