ktvideo.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. Doo::loadCore('db/DooModel');
  3. /**
  4. * Created by PhpStorm.
  5. * User: ellisran
  6. * Date: 2016/9/22
  7. * Time: 16:20
  8. */
  9. class Ktvideo extends DooModel {
  10. public $videoid;
  11. public $videoname;
  12. public $objectname;
  13. public $wy_video_id;
  14. public $classid;
  15. public $typeid;
  16. public $seid;
  17. public $type_video_id;
  18. public $file_time;
  19. public $file_ext;
  20. public $file_size;
  21. public $isshow;
  22. public $addtime;
  23. public $_table = 'kt_video';
  24. public $_primarykey = 'videoid';
  25. public $_fields = array('videoid', 'videoname', 'objectname', 'wy_video_id', 'classid', 'typeid', 'seid', 'type_video_id', 'file_time', 'file_ext', 'file_size', 'isshow', 'addtime');
  26. public function __construct() {
  27. parent::setupModel(__CLASS__);
  28. }
  29. public function getVideobySec($seid) {
  30. return $this->find(array('where' => 'seid='.$seid, 'asc' => 'videoid', 'asArray' => TRUE));
  31. }
  32. public function getVideobySecAndShow($seid) {
  33. return $this->find(array('where' => 'isshow=1 and seid='.$seid, 'asc' => 'videoid', 'asArray' => TRUE));
  34. }
  35. public function getvideobyid($id) {
  36. return $this->getOne(array('select' => 'wy_video_id,videoname,type_video_id,file_ext', 'where' => 'videoid='.$id, 'asArray' => TRUE));
  37. }
  38. public function getsecbyid($id) {
  39. return $this->getOne(array('select' => 'seid', 'where' => 'videoid='.$id, 'asArray' => TRUE));
  40. }
  41. }