info.php 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351
  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. 'pic' => '截图',
  36. 'link' => '链接',
  37. 'desc' => '文字说明',
  38. );
  39. $status = array
  40. (
  41. 1 => '进行中',
  42. 2 => '已结束',
  43. );
  44. return array
  45. (
  46. # 表名
  47. 'name' => 'info',
  48. # 显示给用户看的名称
  49. 'lang' => '任务管理',
  50. 'order' => 200,
  51. # 数据结构
  52. 'struct' => array
  53. (
  54. 'id' => array
  55. (
  56. 'type' => 'int-11',
  57. 'name' => 'ID',
  58. 'default' => '',
  59. 'desc' => '',
  60. 'match' => 'is_numeric',
  61. //'search' => 'order',
  62. 'order' => 'desc',
  63. 'list' => true,
  64. ),
  65. 'hr1' => array
  66. (
  67. 'name' => '基本设置',
  68. 'class' => '',//本项必须填写
  69. 'attr' => '',
  70. ),
  71. 'name' => array
  72. (
  73. 'type' => 'varchar-60',
  74. 'name' => '任务标题',
  75. 'default' => '',
  76. 'desc' => '任务标题',
  77. 'match' => 'is_string',
  78. 'update' => 'text',
  79. 'search' => 'fulltext',
  80. 'list' => true,
  81. ),
  82. 'sdate' => array
  83. (
  84. 'type' => 'int-11',
  85. 'name' => '开始日',
  86. 'match' => 'is_numeric',
  87. 'desc' => '开始时间',
  88. 'update' => 'time',
  89. //'list' => 'date("Y-m-d H:i:s", {sdate})',
  90. 'callback' => 'maketime',
  91. 'list_name' => '时间',
  92. 'list' => 'date("Y-m-d", {sdate})."~".date("Y-m-d", {edate})'
  93. ),
  94. 'edate' => array
  95. (
  96. 'type' => 'int-11',
  97. 'name' => '结束日',
  98. 'match' => 'is_numeric',
  99. 'desc' => '结束日',
  100. 'update' => 'time',
  101. //'list' => 'date("Y-m-d H:i:s", {edate})',
  102. 'callback' => 'maketime',
  103. ),
  104. 'company_id' => array
  105. (
  106. 'type' => 'int-11',
  107. 'name' => '所属商家',
  108. 'default' => '',
  109. 'desc' => '所属商家',
  110. 'match' => 'is_numeric',
  111. 'update' => 'select',
  112. 'search' => 'select',
  113. 'option' => $company,
  114. 'list' => true,
  115. ),
  116. 'level_id' => array
  117. (
  118. 'type' => 'int-11',
  119. 'name' => '任务级别',
  120. 'default' => '',
  121. 'desc' => '任务级别',
  122. 'match' => 'is_numeric',
  123. 'update' => 'select',
  124. 'search' => 'select',
  125. 'option' => $level,
  126. 'list' => true,
  127. ),
  128. 'cate_id' => array
  129. (
  130. 'type' => 'int-11',
  131. 'name' => '任务类别',
  132. 'default' => '',
  133. 'desc' => '任务类别',
  134. 'match' => 'is_numeric',
  135. 'update' => 'radio',
  136. 'search' => 'select',
  137. 'option' => $cate,
  138. 'list' => true,
  139. ),
  140. 'hr2' => array
  141. (
  142. 'name' => '任务限制',
  143. 'class' => '',//本项必须填写
  144. 'attr' => '',
  145. ),
  146. 'num' => array
  147. (
  148. 'type' => 'int-11',
  149. 'name' => '任务领取总人数',
  150. 'default' => '0',
  151. 'match' => '任务领取总人数',
  152. 'match' => 'is_numeric',
  153. 'update' => 'text',
  154. //'list' => true,
  155. ),
  156. 'report_cate_num' => array
  157. (
  158. 'type' => 'int-11',
  159. 'name' => '同一类别参与次数',
  160. 'default' => '0',
  161. 'match' => '同一类别参与次数',
  162. 'match' => 'option',
  163. 'update' => 'text',
  164. //'list' => true,
  165. ),
  166. 'report_company_num' => array
  167. (
  168. 'type' => 'int-11',
  169. 'name' => '同一商家参与次数',
  170. 'default' => '0',
  171. 'match' => '同一商家参与次数',
  172. 'match' => 'option',
  173. 'update' => 'text',
  174. //'list' => true,
  175. ),
  176. 'report_num' => array
  177. (
  178. 'type' => 'int-11',
  179. 'name' => '报告数量上限',
  180. 'default' => '0',
  181. 'match' => '报告数量上限',
  182. 'match' => 'is_numeric',
  183. 'update' => 'text',
  184. //'list' => true,
  185. ),
  186. 'report_user_num' => array
  187. (
  188. 'type' => 'int-11',
  189. 'name' => '人均报告数量',
  190. 'default' => '0',
  191. 'match' => '人均报告数量',
  192. 'match' => 'is_numeric',
  193. 'update' => 'text',
  194. //'list' => true,
  195. ),
  196. 'hr3' => array
  197. (
  198. 'name' => '任务酬劳',
  199. 'class' => '',//本项必须填写
  200. 'attr' => '',
  201. ),
  202. 'task_cash' => array
  203. (
  204. 'type' => 'int-11',
  205. 'name' => '单任务报告酬劳',
  206. 'default' => '0',
  207. 'match' => '单任务报告酬劳',
  208. 'match' => 'is_numeric',
  209. 'update' => 'text',
  210. //'list' => true,
  211. ),
  212. 'group_cash' => array
  213. (
  214. 'type' => 'int-11',
  215. 'name' => '下线提成酬劳',
  216. 'default' => '0',
  217. 'match' => '下线提成酬劳',
  218. 'match' => 'is_numeric',
  219. 'update' => 'text',
  220. //'list' => true,
  221. ),
  222. 'hr4' => array
  223. (
  224. 'name' => '其他设置',
  225. 'class' => '',//本项必须填写
  226. 'attr' => '',
  227. ),
  228. 'report_demand' => array
  229. (
  230. 'type' => 'varchar-50',
  231. 'name' => '报告要求',
  232. 'default' => 'username',
  233. 'desc' => '状态',
  234. 'match' => 'is_numeric',
  235. 'update' => 'checkbox',
  236. 'option' => $demand,
  237. //'list' => true,
  238. ),
  239. 'content' => array
  240. (
  241. 'type' => 'text-255',
  242. 'name' => '任务说明',
  243. 'default' => '',
  244. 'desc' => '任务说明',
  245. 'match' => 'option',
  246. 'update' => 'editor',
  247. ),
  248. 'status' => array
  249. (
  250. 'type' => 'tinyint-1',
  251. 'name' => '状态',
  252. 'default' => '1',
  253. 'desc' => '状态',
  254. 'match' => 'is_numeric',
  255. 'update' => 'select',
  256. 'option' => $status,
  257. 'search' => 'select',
  258. 'list' => true,
  259. 'edit' => true,
  260. ),
  261. 'reorder' => array
  262. (
  263. 'type' => 'int-11',
  264. 'name' => '排序(数值越大越靠前)',
  265. 'default' => '1',
  266. 'desc' => '请输入排序',
  267. 'match' => 'option',
  268. 'update' => 'text',
  269. 'search' => 'order',
  270. 'list_name' => '排序',
  271. 'list' => true,
  272. 'order' => 'desc',
  273. 'edit' => true,
  274. ),
  275. 'state' => array
  276. (
  277. 'type' => 'tinyint-1',
  278. 'name' => '状态',
  279. 'default' => '1',
  280. 'desc' => '请选择状态',
  281. 'match' => 'is_numeric',
  282. ),
  283. 'cdate' => array
  284. (
  285. 'type' => 'int-11',
  286. 'name' => '录入时间',
  287. 'match' => array('is_numeric', time()),
  288. 'desc' => '',
  289. # 只有insert时才生效
  290. 'insert' => true,
  291. //'search' => 'date',
  292. //'list' => 'date("Y-m-d H:i:s", {cdate})',
  293. ),
  294. ),
  295. 'manage' => array
  296. (
  297. ),
  298. 'request' => array
  299. (
  300. 'getAll' => array
  301. (
  302. # 匹配的正则或函数 选填项
  303. 'option' => array
  304. (
  305. 'company_id' => 'yes',
  306. 'level_id' => 'yes',
  307. 'cate_id' => 'yes',
  308. 'end' => array('yes-edate', '<'),
  309. 'status' => 1,
  310. 'state' => 1,
  311. ),
  312. 'type' => 'all',
  313. 'order' => array('reorder' => 'desc', 'cdate' => 'desc'),
  314. 'page' => array(15, 'list'),
  315. 'col' => '*',
  316. ),
  317. )
  318. );