info.php 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382
  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' => true,
  174. ),
  175. 'cate_num' => array
  176. (
  177. 'type' => 'int-11',
  178. 'name' => '同一类别参与次数',
  179. 'default' => '0',
  180. 'match' => '同一类别参与次数',
  181. 'match' => 'option',
  182. 'update' => 'text',
  183. //'list' => true,
  184. ),
  185. 'company_num' => array
  186. (
  187. 'type' => 'int-11',
  188. 'name' => '同一商家参与次数',
  189. 'default' => '0',
  190. 'match' => '同一商家参与次数',
  191. 'match' => 'option',
  192. 'update' => 'text',
  193. //'list' => true,
  194. ),
  195. 'report_num' => array
  196. (
  197. 'type' => 'int-11',
  198. 'name' => '报告数量上限',
  199. 'default' => '0',
  200. 'match' => '报告数量上限',
  201. 'match' => 'is_numeric',
  202. 'update' => 'text',
  203. //'list' => true,
  204. ),
  205. 'report_user_num' => array
  206. (
  207. 'type' => 'int-11',
  208. 'name' => '人均报告数量',
  209. 'default' => '0',
  210. 'match' => '人均报告数量',
  211. 'match' => 'is_numeric',
  212. 'update' => 'text',
  213. //'list' => true,
  214. ),
  215. 'hr3' => array
  216. (
  217. 'name' => '任务酬劳',
  218. 'class' => '',//本项必须填写
  219. 'attr' => '',
  220. ),
  221. 'score' => array
  222. (
  223. 'type' => 'int-11',
  224. 'name' => '单任务报告酬劳',
  225. 'default' => '0',
  226. 'match' => '单任务报告酬劳',
  227. 'match' => 'is_numeric',
  228. 'update' => 'text',
  229. //'list' => true,
  230. ),
  231. 'group_score' => array
  232. (
  233. 'type' => 'int-11',
  234. 'name' => '下线提成酬劳',
  235. 'default' => '0',
  236. 'match' => '下线提成酬劳',
  237. 'match' => 'is_numeric',
  238. 'update' => 'text',
  239. //'list' => true,
  240. ),
  241. 'hr4' => array
  242. (
  243. 'name' => '其他设置',
  244. 'class' => '',//本项必须填写
  245. 'attr' => '',
  246. ),
  247. 'report_demand' => array
  248. (
  249. 'type' => 'varchar-50',
  250. 'name' => '报告要求',
  251. 'default' => 'username',
  252. 'desc' => '状态',
  253. 'match' => 'option',
  254. 'update' => 'checkbox',
  255. 'option' => $demand,
  256. //'list' => true,
  257. ),
  258. 'content' => array
  259. (
  260. 'type' => 'text-255',
  261. 'name' => '任务说明',
  262. 'default' => '',
  263. 'desc' => '任务说明',
  264. 'match' => 'option',
  265. 'update' => 'editor',
  266. ),
  267. 'status' => array
  268. (
  269. 'type' => 'tinyint-1',
  270. 'name' => '状态',
  271. 'default' => '1',
  272. 'desc' => '状态',
  273. 'match' => 'is_numeric',
  274. 'update' => 'select',
  275. 'option' => $status,
  276. 'search' => 'select',
  277. 'list' => true,
  278. 'edit' => true,
  279. ),
  280. 'reorder' => array
  281. (
  282. 'type' => 'int-11',
  283. 'name' => '排序(数值越大越靠前)',
  284. 'default' => '1',
  285. 'desc' => '请输入排序',
  286. 'match' => 'option',
  287. 'update' => 'text',
  288. 'search' => 'order',
  289. 'list_name' => '排序',
  290. 'list' => true,
  291. 'order' => 'desc',
  292. 'edit' => true,
  293. ),
  294. 'state' => array
  295. (
  296. 'type' => 'tinyint-1',
  297. 'name' => '状态',
  298. 'default' => '1',
  299. 'desc' => '请选择状态',
  300. 'match' => 'is_numeric',
  301. ),
  302. 'cdate' => array
  303. (
  304. 'type' => 'int-11',
  305. 'name' => '录入时间',
  306. 'match' => array('is_numeric', time()),
  307. 'desc' => '',
  308. # 只有insert时才生效
  309. 'insert' => true,
  310. //'search' => 'date',
  311. //'list' => 'date("Y-m-d H:i:s", {cdate})',
  312. ),
  313. ),
  314. 'manage' => array
  315. (
  316. ),
  317. 'request' => array
  318. (
  319. 'getAll' => array
  320. (
  321. # 匹配的正则或函数 选填项
  322. 'option' => array
  323. (
  324. 'company_id' => 'yes',
  325. 'level_id' => 'yes',
  326. 'cate_id' => 'yes',
  327. 'end' => array('yes-edate', '<'),
  328. 'status' => 1,
  329. 'state' => 1,
  330. ),
  331. 'type' => 'all',
  332. 'order' => array('reorder' => 'desc', 'edate' => 'asc'),
  333. 'page' => array(15, 'list'),
  334. 'col' => '*',
  335. ),
  336. 'gets' => array
  337. (
  338. # 匹配的正则或函数 选填项
  339. 'option' => array
  340. (
  341. 'state' => 1,
  342. ),
  343. 'type' => 'all',
  344. 'order' => array('reorder' => 'desc', 'edate' => 'asc'),
  345. 'col' => '*',
  346. ),
  347. )
  348. );