info.php 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232
  1. <?php
  2. $cate = function()
  3. {
  4. $array = array();
  5. $info = Dever::db('task/cate')->state();
  6. if($info)
  7. {
  8. $array += $info;
  9. }
  10. return $array;
  11. };
  12. $level = function()
  13. {
  14. $array = array();
  15. $info = Dever::db('task/level')->state();
  16. if($info)
  17. {
  18. $array += $info;
  19. }
  20. return $array;
  21. };
  22. $company = function()
  23. {
  24. $array = array();
  25. $info = Dever::db('task/company')->state();
  26. if($info)
  27. {
  28. $array += $info;
  29. }
  30. return $array;
  31. };
  32. $demand = array
  33. (
  34. 'username' => '账号名',
  35. 'crop' => '截图',
  36. 'link' => '链接',
  37. 'desc' => '文字说明',
  38. );
  39. return array
  40. (
  41. # 表名
  42. 'name' => 'info',
  43. # 显示给用户看的名称
  44. 'lang' => '任务管理',
  45. 'order' => 200,
  46. # 数据结构
  47. 'struct' => array
  48. (
  49. 'id' => array
  50. (
  51. 'type' => 'int-11',
  52. 'name' => 'ID',
  53. 'default' => '',
  54. 'desc' => '',
  55. 'match' => 'is_numeric',
  56. //'search' => 'order',
  57. 'order' => 'desc',
  58. 'list' => true,
  59. ),
  60. 'hr1' => array
  61. (
  62. 'name' => '基本设置',
  63. 'class' => '',//本项必须填写
  64. 'attr' => '',
  65. ),
  66. 'name' => array
  67. (
  68. 'type' => 'varchar-60',
  69. 'name' => '任务标题',
  70. 'default' => '',
  71. 'desc' => '任务标题',
  72. 'match' => 'is_string',
  73. 'update' => 'text',
  74. 'search' => 'fulltext',
  75. 'list' => true,
  76. ),
  77. 'sdate' => array
  78. (
  79. 'type' => 'int-11',
  80. 'name' => '开始日',
  81. 'match' => 'is_numeric',
  82. 'desc' => '开始时间',
  83. 'update' => 'time',
  84. //'list' => 'date("Y-m-d H:i:s", {sdate})',
  85. 'callback' => 'maketime',
  86. 'list_name' => '时间',
  87. 'list' => 'date("Y-m-d", {sdate})."~".date("Y-m-d", {edate})'
  88. ),
  89. 'edate' => array
  90. (
  91. 'type' => 'int-11',
  92. 'name' => '结束日',
  93. 'match' => 'is_numeric',
  94. 'desc' => '结束日',
  95. 'update' => 'time',
  96. //'list' => 'date("Y-m-d H:i:s", {edate})',
  97. 'callback' => 'maketime',
  98. ),
  99. 'company_id' => array
  100. (
  101. 'type' => 'int-11',
  102. 'name' => '所属商家',
  103. 'default' => '',
  104. 'desc' => '所属商家',
  105. 'match' => 'is_numeric',
  106. 'update' => 'select',
  107. 'search' => 'select',
  108. 'option' => $company,
  109. 'list' => true,
  110. ),
  111. 'level_id' => array
  112. (
  113. 'type' => 'int-11',
  114. 'name' => '任务级别',
  115. 'default' => '',
  116. 'desc' => '任务级别',
  117. 'match' => 'is_numeric',
  118. 'update' => 'select',
  119. 'search' => 'select',
  120. 'option' => $level,
  121. 'list' => true,
  122. ),
  123. 'cate_id' => array
  124. (
  125. 'type' => 'int-11',
  126. 'name' => '任务类别',
  127. 'default' => '',
  128. 'desc' => '任务类别',
  129. 'match' => 'is_numeric',
  130. 'update' => 'radio',
  131. 'search' => 'select',
  132. 'option' => $cate,
  133. 'list' => true,
  134. ),
  135. 'hr2' => array
  136. (
  137. 'name' => '限制设置',
  138. 'class' => '',//本项必须填写
  139. 'attr' => '',
  140. ),
  141. 'num' => array
  142. (
  143. 'type' => 'int-11',
  144. 'name' => '领取人数',
  145. 'default' => '0',
  146. 'match' => '领取人数',
  147. 'match' => 'is_numeric',
  148. 'update' => 'text',
  149. //'list' => true,
  150. ),
  151. 'report_num' => array
  152. (
  153. 'type' => 'int-11',
  154. 'name' => '报告上限',
  155. 'default' => '0',
  156. 'match' => '报告上限',
  157. 'match' => 'is_numeric',
  158. 'update' => 'text',
  159. //'list' => true,
  160. ),
  161. 'hr3' => array
  162. (
  163. 'name' => '限制设置',
  164. 'class' => '',//本项必须填写
  165. 'attr' => '',
  166. ),
  167. 'report_demand' => array
  168. (
  169. 'type' => 'varchar-50',
  170. 'name' => '报告要求',
  171. 'default' => 'username',
  172. 'desc' => '状态',
  173. 'match' => 'is_numeric',
  174. 'update' => 'checkbox',
  175. 'option' => $demand,
  176. //'list' => true,
  177. ),
  178. 'content' => array
  179. (
  180. 'type' => 'text-255',
  181. 'name' => '任务说明',
  182. 'default' => '',
  183. 'desc' => '任务说明',
  184. 'match' => 'option',
  185. 'update' => 'editor',
  186. ),
  187. 'state' => array
  188. (
  189. 'type' => 'tinyint-1',
  190. 'name' => '状态',
  191. 'default' => '1',
  192. 'desc' => '请选择状态',
  193. 'match' => 'is_numeric',
  194. ),
  195. 'cdate' => array
  196. (
  197. 'type' => 'int-11',
  198. 'name' => '录入时间',
  199. 'match' => array('is_numeric', time()),
  200. 'desc' => '',
  201. # 只有insert时才生效
  202. 'insert' => true,
  203. //'search' => 'date',
  204. //'list' => 'date("Y-m-d H:i:s", {cdate})',
  205. ),
  206. ),
  207. 'manage' => array
  208. (
  209. ),
  210. );