form_id.php 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. <?php
  2. $auth = Dever::tops();
  3. $type = array
  4. (
  5. 1 => '普通表单',
  6. 2 => '支付表单',
  7. );
  8. $cate = function() use ($auth)
  9. {
  10. $array = array();
  11. if ($auth) {
  12. $info = Dever::db('journal/cate')->getIds(array('ids' => $auth));
  13. } else {
  14. $info = Dever::db('journal/cate')->state();
  15. }
  16. if($info)
  17. {
  18. $array += $info;
  19. }
  20. return $array;
  21. };
  22. $time = time()+(3600*24*7);
  23. return array
  24. (
  25. # 表名
  26. 'name' => 'form_id',
  27. # 显示给用户看的名称
  28. 'lang' => '模板form_id收集表',
  29. 'menu' => false,
  30. # 数据结构
  31. 'struct' => array
  32. (
  33. 'id' => array
  34. (
  35. 'type' => 'int-11',
  36. 'name' => 'ID',
  37. 'default' => '',
  38. 'desc' => '',
  39. 'match' => 'is_numeric',
  40. 'search' => 'order',
  41. 'list' => true,
  42. ),
  43. 'type' => array
  44. (
  45. 'type' => 'tinyint-1',
  46. 'name' => '类型',
  47. 'default' => '1',
  48. 'desc' => '类型',
  49. 'match' => 'option',
  50. 'search' => 'select',
  51. 'option' => $type,
  52. 'list' => true,
  53. ),
  54. 'cate_id' => array
  55. (
  56. 'type' => 'int-11',
  57. 'name' => '小刊分类',
  58. 'default' => '1',
  59. 'desc' => '小刊分类',
  60. 'match' => 'is_numeric',
  61. 'update' => 'select',
  62. 'option' => $cate,
  63. //'search' => 'select',
  64. 'list' => true,
  65. ),
  66. 'num' => array
  67. (
  68. 'type' => 'int-11',
  69. 'name' => '使用次数',
  70. 'default' => '0',
  71. 'desc' => '使用次数',
  72. 'match' => 'is_numeric',
  73. 'list' => true,
  74. ),
  75. 'uid' => array
  76. (
  77. 'type' => 'int-11',
  78. 'name' => '用户id',
  79. 'default' => '',
  80. 'desc' => '用户id',
  81. 'match' => 'is_numeric',
  82. 'list' => true,
  83. ),
  84. 'form_id' => array
  85. (
  86. 'type' => 'varchar-700',
  87. 'name' => 'form_id',
  88. 'default' => '',
  89. 'desc' => 'form_id',
  90. 'match' => 'is_string',
  91. 'update' => 'text',
  92. 'search' => 'fulltext',
  93. 'list' => true,
  94. ),
  95. 'state' => array
  96. (
  97. 'type' => 'tinyint-1',
  98. 'name' => '状态',
  99. 'default' => '1',
  100. 'desc' => '请选择状态',
  101. 'match' => 'is_numeric',
  102. ),
  103. 'cdate' => array
  104. (
  105. 'type' => 'int-11',
  106. 'name' => '更新时间',
  107. 'match' => array('is_numeric', time()),
  108. 'desc' => '',
  109. 'default' => '',
  110. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  111. ),
  112. ),
  113. 'top' => Dever::config('base', 'applet')->top,
  114. 'manage' => array
  115. (
  116. //'delete' => false,
  117. 'insert' => false,
  118. 'edit' => false,
  119. ),
  120. 'request' => array
  121. (
  122. 'getAll' => array
  123. (
  124. # 匹配的正则或函数 选填项
  125. 'option' => array
  126. (
  127. 'num' => array('yes', '<'),
  128. 'type' => 'yes',
  129. 'uid' => 'yes',
  130. 'cdate' => array($time, '<='),
  131. 'state' => 1,
  132. ),
  133. 'type' => 'all',
  134. 'order' => array('cdate' => 'desc'),
  135. 'limit' => '0,100',
  136. 'col' => '*',
  137. ),
  138. 'getAllGroupByUid' => array
  139. (
  140. # 匹配的正则或函数 选填项
  141. 'option' => array
  142. (
  143. 'type' => 'yes',
  144. 'cdate' => array($time, '<='),
  145. 'state' => 1,
  146. ),
  147. 'type' => 'all',
  148. 'group' => 'uid',
  149. 'order' => array('cdate' => 'desc'),
  150. 'col' => '*',
  151. ),
  152. ),
  153. );