info.php 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386
  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. 3 => '已结束',
  44. );
  45. return array
  46. (
  47. # 表名
  48. 'name' => 'info',
  49. # 显示给用户看的名称
  50. 'lang' => '任务管理',
  51. 'desc' => '可将lib/cron.task加入到计划任务,建议间隔时间为86400,每天凌晨执行,将自动清理过期的任务',
  52. 'order' => 200,
  53. # 更新后,要把company_id等信息同步给user_task,方便统计
  54. 'sync' => array
  55. (
  56. 'task/user_task' => array
  57. (
  58. # 更新另外一个表的字段 => 本表的字段
  59. 'where' => array('task_id', 'id'),
  60. # 要更新的数据
  61. 'update' => array(
  62. 'company_id' => 'company_id',
  63. 'level_id' => 'level_id',
  64. 'cate_id' => 'cate_id',
  65. ),
  66. # 同步更新的类型,delete为先删再插入,update为先查询是否存在,存在直接更新,不存在则插入, only为仅更新
  67. 'type' => 'only',
  68. )
  69. ),
  70. # 数据结构
  71. 'struct' => array
  72. (
  73. 'id' => array
  74. (
  75. 'type' => 'int-11',
  76. 'name' => 'ID',
  77. 'default' => '',
  78. 'desc' => '',
  79. 'match' => 'is_numeric',
  80. //'search' => 'order',
  81. 'order' => 'desc',
  82. 'list' => true,
  83. ),
  84. 'hr1' => array
  85. (
  86. 'name' => '基本设置',
  87. 'class' => '',//本项必须填写
  88. 'attr' => '',
  89. ),
  90. 'name' => array
  91. (
  92. 'type' => 'varchar-60',
  93. 'name' => '任务标题',
  94. 'default' => '',
  95. 'desc' => '任务标题',
  96. 'match' => 'is_string',
  97. 'update' => 'text',
  98. 'search' => 'fulltext',
  99. 'list' => true,
  100. ),
  101. 'sdate' => array
  102. (
  103. 'type' => 'int-11',
  104. 'name' => '开始日',
  105. 'match' => 'is_numeric',
  106. 'desc' => '开始时间',
  107. 'update' => 'time',
  108. //'list' => 'date("Y-m-d H:i:s", {sdate})',
  109. 'callback' => 'maketime',
  110. 'list_name' => '时间',
  111. 'list' => 'date("Y-m-d", {sdate})."~".date("Y-m-d", {edate})'
  112. ),
  113. 'edate' => array
  114. (
  115. 'type' => 'int-11',
  116. 'name' => '结束日',
  117. 'match' => 'is_numeric',
  118. 'desc' => '结束日',
  119. 'update' => 'time',
  120. //'list' => 'date("Y-m-d H:i:s", {edate})',
  121. 'callback' => 'maketime',
  122. ),
  123. 'company_id' => array
  124. (
  125. 'type' => 'int-11',
  126. 'name' => '所属商家',
  127. 'default' => '',
  128. 'desc' => '所属商家',
  129. 'match' => 'is_numeric',
  130. 'update' => 'select',
  131. 'search' => 'select',
  132. 'option' => $company,
  133. 'list' => true,
  134. ),
  135. 'level_id' => array
  136. (
  137. 'type' => 'int-11',
  138. 'name' => '任务级别',
  139. 'default' => '',
  140. 'desc' => '任务级别',
  141. 'match' => 'is_numeric',
  142. 'update' => 'select',
  143. 'search' => 'select',
  144. 'option' => $level,
  145. //'list' => true,
  146. ),
  147. 'cate_id' => array
  148. (
  149. 'type' => 'int-11',
  150. 'name' => '任务类别',
  151. 'default' => '',
  152. 'desc' => '任务类别',
  153. 'match' => 'is_numeric',
  154. 'update' => 'radio',
  155. 'search' => 'select',
  156. 'option' => $cate,
  157. //'list' => true,
  158. ),
  159. 'hr2' => array
  160. (
  161. 'name' => '任务限制',
  162. 'class' => '',//本项必须填写
  163. 'attr' => '',
  164. ),
  165. 'num' => array
  166. (
  167. 'type' => 'int-11',
  168. 'name' => '任务领取总人数',
  169. 'default' => '0',
  170. 'match' => '任务领取总人数',
  171. 'match' => 'is_numeric',
  172. 'update' => 'text',
  173. 'list_name' => '统计信息',
  174. 'list' => 'Dever::load("task/lib/manage.task", {id})',
  175. ),
  176. 'cate_num' => array
  177. (
  178. 'type' => 'int-11',
  179. 'name' => '同一类别参与次数',
  180. 'default' => '0',
  181. 'match' => '同一类别参与次数',
  182. 'match' => 'option',
  183. 'update' => 'text',
  184. //'list' => true,
  185. ),
  186. 'company_num' => array
  187. (
  188. 'type' => 'int-11',
  189. 'name' => '同一商家参与次数',
  190. 'default' => '0',
  191. 'match' => '同一商家参与次数',
  192. 'match' => 'option',
  193. 'update' => 'text',
  194. //'list' => true,
  195. ),
  196. 'report_num' => array
  197. (
  198. 'type' => 'int-11',
  199. 'name' => '报告数量上限',
  200. 'default' => '0',
  201. 'match' => '报告数量上限',
  202. 'match' => 'is_numeric',
  203. 'update' => 'text',
  204. //'list' => true,
  205. ),
  206. 'report_user_num' => array
  207. (
  208. 'type' => 'int-11',
  209. 'name' => '人均报告数量',
  210. 'default' => '0',
  211. 'match' => '人均报告数量',
  212. 'match' => 'is_numeric',
  213. 'update' => 'text',
  214. //'list' => true,
  215. ),
  216. 'hr3' => array
  217. (
  218. 'name' => '任务酬劳',
  219. 'class' => '',//本项必须填写
  220. 'attr' => '',
  221. ),
  222. 'score' => array
  223. (
  224. 'type' => 'int-11',
  225. 'name' => '单任务报告酬劳',
  226. 'default' => '0',
  227. 'match' => '单任务报告酬劳',
  228. 'match' => 'is_numeric',
  229. 'update' => 'text',
  230. //'list' => true,
  231. ),
  232. 'group_score' => array
  233. (
  234. 'type' => 'int-11',
  235. 'name' => '下线提成酬劳',
  236. 'default' => '0',
  237. 'match' => '下线提成酬劳',
  238. 'match' => 'is_numeric',
  239. 'update' => 'text',
  240. //'list' => true,
  241. ),
  242. 'hr4' => array
  243. (
  244. 'name' => '其他设置',
  245. 'class' => '',//本项必须填写
  246. 'attr' => '',
  247. ),
  248. 'report_demand' => array
  249. (
  250. 'type' => 'varchar-50',
  251. 'name' => '报告要求',
  252. 'default' => 'username',
  253. 'desc' => '状态',
  254. 'match' => 'option',
  255. 'update' => 'checkbox',
  256. 'option' => $demand,
  257. //'list' => true,
  258. ),
  259. 'content' => array
  260. (
  261. 'type' => 'text-255',
  262. 'name' => '任务说明',
  263. 'default' => '',
  264. 'desc' => '任务说明',
  265. 'match' => 'option',
  266. 'update' => 'editor',
  267. ),
  268. 'status' => array
  269. (
  270. 'type' => 'tinyint-1',
  271. 'name' => '状态',
  272. 'default' => '1',
  273. 'desc' => '状态',
  274. 'match' => 'is_numeric',
  275. 'update' => 'select',
  276. 'option' => $status,
  277. 'search' => 'select',
  278. 'list' => true,
  279. 'edit' => true,
  280. ),
  281. 'reorder' => array
  282. (
  283. 'type' => 'int-11',
  284. 'name' => '排序(数值越大越靠前)',
  285. 'default' => '1',
  286. 'desc' => '请输入排序',
  287. 'match' => 'option',
  288. 'update' => 'text',
  289. 'search' => 'order',
  290. 'list_name' => '排序',
  291. 'list' => true,
  292. 'order' => 'desc',
  293. 'edit' => true,
  294. ),
  295. 'state' => array
  296. (
  297. 'type' => 'tinyint-1',
  298. 'name' => '状态',
  299. 'default' => '1',
  300. 'desc' => '请选择状态',
  301. 'match' => 'is_numeric',
  302. ),
  303. 'cdate' => array
  304. (
  305. 'type' => 'int-11',
  306. 'name' => '录入时间',
  307. 'match' => array('is_numeric', time()),
  308. 'desc' => '',
  309. # 只有insert时才生效
  310. 'insert' => true,
  311. //'search' => 'date',
  312. //'list' => 'date("Y-m-d H:i:s", {cdate})',
  313. ),
  314. ),
  315. 'manage' => array
  316. (
  317. 'list_button' => array
  318. (
  319. 'delete' => array('删除', '', '{status} == 2'),
  320. ),
  321. ),
  322. 'request' => array
  323. (
  324. 'getAll' => array
  325. (
  326. # 匹配的正则或函数 选填项
  327. 'option' => array
  328. (
  329. 'company_id' => 'yes',
  330. 'level_id' => 'yes',
  331. 'cate_id' => 'yes',
  332. 'end' => array('yes-edate', '<'),
  333. 'status' => 1,
  334. 'state' => 1,
  335. ),
  336. 'type' => 'all',
  337. 'order' => array('reorder' => 'desc', 'edate' => 'asc'),
  338. 'page' => array(15, 'list'),
  339. 'col' => '*',
  340. ),
  341. 'gets' => array
  342. (
  343. # 匹配的正则或函数 选填项
  344. 'option' => array
  345. (
  346. 'state' => 1,
  347. ),
  348. 'type' => 'all',
  349. 'order' => array('reorder' => 'desc', 'edate' => 'asc'),
  350. 'col' => '*',
  351. ),
  352. )
  353. );