stream_log.php 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. <?php
  2. $live = function()
  3. {
  4. $array = array();
  5. $info = Dever::db('live/info')->state();
  6. if($info)
  7. {
  8. $array += $info;
  9. }
  10. return $array;
  11. };
  12. $active = function()
  13. {
  14. $array = array();
  15. $info = Dever::db('live/active')->state();
  16. if($info)
  17. {
  18. $array += $info;
  19. }
  20. return $array;
  21. };
  22. $stream = function()
  23. {
  24. $array = array();
  25. $info = Dever::db('live/stream')->state();
  26. if($info)
  27. {
  28. $array += $info;
  29. }
  30. return $array;
  31. };
  32. return array
  33. (
  34. # 表名
  35. 'name' => 'stream_log',
  36. # 显示给用户看的名称
  37. 'lang' => '直播流日志',
  38. 'order' => 2,
  39. 'menu' => false,
  40. # 数据结构
  41. 'struct' => array
  42. (
  43. 'id' => array
  44. (
  45. 'type' => 'int-11',
  46. 'name' => 'ID',
  47. 'default' => '',
  48. 'desc' => '',
  49. 'match' => 'is_numeric',
  50. 'search' => 'order',
  51. 'list' => true,
  52. ),
  53. 'live_id' => array
  54. (
  55. 'type' => 'int-11',
  56. 'name' => '所属直播云',
  57. 'default' => '1',
  58. 'desc' => '所属直播云',
  59. 'match' => 'is_numeric',
  60. 'update' => 'select',
  61. //'option' => $live,
  62. 'search' => 'select',
  63. //'list' => true,
  64. ),
  65. 'active_id' => array
  66. (
  67. 'type' => 'int-11',
  68. 'name' => '所属活动',
  69. 'default' => '1',
  70. 'desc' => '所属活动',
  71. 'match' => 'is_numeric',
  72. 'update' => 'select',
  73. //'option' => $active,
  74. 'search' => 'select',
  75. //'list' => true,
  76. ),
  77. 'stream_id' => array
  78. (
  79. 'type' => 'int-11',
  80. 'name' => '所属直播流',
  81. 'default' => '1',
  82. 'desc' => '所属直播流',
  83. 'match' => 'is_numeric',
  84. //'update' => 'select',
  85. 'option' => $stream,
  86. //'search' => 'select',
  87. 'list' => true,
  88. ),
  89. 'sdate' => array
  90. (
  91. 'type' => 'int-11',
  92. 'name' => '开始时间',
  93. 'match' => 'is_numeric',
  94. 'default' => '',
  95. 'desc' => '',
  96. 'update' => 'date',
  97. 'callback' => 'maketime',
  98. 'list' => '{sdate} > 0 ? date("Y-m-d H:i:s", {sdate}) : "未开始"',
  99. ),
  100. 'edate' => array
  101. (
  102. 'type' => 'int-11',
  103. 'name' => '结束时间',
  104. 'match' => 'is_numeric',
  105. 'default' => '',
  106. 'desc' => '',
  107. //'update' => 'date',
  108. 'callback' => 'maketime',
  109. 'list' => '{edate} > 0 ? date("Y-m-d H:i:s", {edate}) : "未结束"',
  110. ),
  111. 'url_m3u8' => array
  112. (
  113. 'type' => 'varchar-800',
  114. 'name' => '直播回放地址',
  115. 'default' => '',
  116. 'desc' => '直播回放地址',
  117. 'match' => 'option',
  118. //'update' => 'text',
  119. 'list' => true,
  120. ),
  121. 'url_mp4' => array
  122. (
  123. 'type' => 'varchar-800',
  124. 'name' => '直播回放地址',
  125. 'default' => '',
  126. 'desc' => '直播回放地址',
  127. 'match' => 'option',
  128. //'update' => 'text',
  129. 'list' => true,
  130. ),
  131. 'state' => array
  132. (
  133. 'type' => 'tinyint-1',
  134. 'name' => '状态',
  135. 'default' => '1',
  136. 'desc' => '请选择状态',
  137. 'match' => 'is_numeric',
  138. ),
  139. 'cdate' => array
  140. (
  141. 'type' => 'int-11',
  142. 'name' => '创建时间',
  143. 'match' => array('is_numeric', time()),
  144. 'desc' => '',
  145. # 只有insert时才生效
  146. 'insert' => true,
  147. //'search' => 'date',
  148. //'list' => 'date("Y-m-d H:i:s", {cdate})',
  149. ),
  150. ),
  151. 'manage' => array
  152. (
  153. //'excel' => true,
  154. 'delete' => false,
  155. 'edit' => false,
  156. //'insert' => false,
  157. ),
  158. );