info.php 7.1 KB

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