active.php 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  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. $type = Dever::config('base', 'live')->live_type;
  13. $status = Dever::config('base')->status;
  14. return array
  15. (
  16. # 表名
  17. 'name' => 'active',
  18. # 显示给用户看的名称
  19. 'lang' => '直播活动',
  20. 'order' => 20,
  21. # 数据结构
  22. 'struct' => array
  23. (
  24. 'id' => array
  25. (
  26. 'type' => 'int-11',
  27. 'name' => 'ID',
  28. 'default' => '',
  29. 'desc' => '',
  30. 'match' => 'is_numeric',
  31. 'search' => 'order',
  32. //'list' => true,
  33. ),
  34. 'name' => array
  35. (
  36. 'type' => 'varchar-300',
  37. 'name' => '活动名称',
  38. 'default' => '',
  39. 'desc' => '活动名称',
  40. 'match' => 'option',
  41. 'update' => 'text',
  42. 'list' => true,
  43. ),
  44. 'live_id' => array
  45. (
  46. 'type' => 'int-11',
  47. 'name' => '所属直播云',
  48. 'default' => '1',
  49. 'desc' => '所属直播云',
  50. 'match' => 'is_numeric',
  51. 'update' => 'select',
  52. 'option' => $live,
  53. 'search' => 'select',
  54. 'list' => true,
  55. ),
  56. 'status' => array
  57. (
  58. 'type' => 'int-11',
  59. 'name' => '上线状态',
  60. 'default' => '2',
  61. 'desc' => '上线状态',
  62. 'match' => 'is_numeric',
  63. //'update' => 'select',
  64. 'option' => $status,
  65. 'search' => 'select',
  66. 'list' => true,
  67. 'edit' => true,
  68. ),
  69. 'reorder' => array
  70. (
  71. 'type' => 'int-11',
  72. 'name' => '排序(数值越大越靠前)',
  73. 'default' => '1',
  74. 'desc' => '请输入排序',
  75. 'match' => 'option',
  76. 'update' => 'text',
  77. 'search' => 'order',
  78. 'list' => true,
  79. 'order' => 'desc',
  80. 'edit' => true,
  81. ),
  82. 'state' => array
  83. (
  84. 'type' => 'tinyint-1',
  85. 'name' => '状态',
  86. 'default' => '1',
  87. 'desc' => '请选择状态',
  88. 'match' => 'is_numeric',
  89. ),
  90. 'cdate' => array
  91. (
  92. 'type' => 'int-11',
  93. 'name' => '创建时间',
  94. 'match' => array('is_numeric', time()),
  95. 'desc' => '',
  96. # 只有insert时才生效
  97. 'insert' => true,
  98. //'search' => 'date',
  99. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  100. ),
  101. ),
  102. 'manage' => array
  103. (
  104. //'excel' => true,
  105. //'delete' => false,
  106. //'edit' => false,
  107. //'insert' => false,
  108. ),
  109. # request 请求接口定义
  110. 'request' => array
  111. (
  112. 'getAll' => array
  113. (
  114. # 匹配的正则或函数 选填项
  115. 'option' => array
  116. (
  117. 'status' => 'yes',
  118. 'state' => 1,
  119. ),
  120. 'type' => 'all',
  121. 'order' => array('id' => 'desc'),
  122. 'col' => 'id,name,live_id',
  123. ),
  124. )
  125. );