user_task.php 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. <?php
  2. $status = array
  3. (
  4. 1 => '正常',
  5. 2 => '异常',
  6. );
  7. $company = function()
  8. {
  9. $array = array();
  10. $info = Dever::load('task/company-state');
  11. if($info)
  12. {
  13. $array += $info;
  14. }
  15. return $array;
  16. };
  17. $cate = function()
  18. {
  19. $array = array();
  20. $info = Dever::load('task/cate-state');
  21. if($info)
  22. {
  23. $array += $info;
  24. }
  25. return $array;
  26. };
  27. return array
  28. (
  29. # 表名
  30. 'name' => 'user_task',
  31. # 显示给用户看的名称
  32. 'lang' => '用户任务',
  33. 'menu' => 'passport',
  34. 'order' => 100,
  35. # 数据结构
  36. 'struct' => array
  37. (
  38. 'id' => array
  39. (
  40. 'type' => 'int-11',
  41. 'name' => 'ID',
  42. 'default' => '',
  43. 'desc' => '',
  44. 'match' => 'is_numeric',
  45. //'search' => 'order',
  46. 'order' => 'desc',
  47. 'list' => true,
  48. ),
  49. 'uid' => array
  50. (
  51. 'type' => 'int-11',
  52. 'name' => '用户名',
  53. 'default' => '',
  54. 'desc' => '用户名',
  55. 'match' => 'is_numeric',
  56. //'update' => 'text',
  57. 'search' => array
  58. (
  59. 'api' => 'passport/user-all',
  60. 'col' => 'username',
  61. 'result' => 'id',
  62. ),
  63. 'list' => 'Dever::load("passport/user-one#username", {uid})',
  64. ),
  65. 'task_id' => array
  66. (
  67. 'type' => 'int-11',
  68. 'name' => '任务名',
  69. 'default' => '-1',
  70. 'desc' => '任务名',
  71. 'match' => 'is_numeric',
  72. //'update' => 'select',
  73. 'search' => array
  74. (
  75. 'api' => 'task/info-all',
  76. 'col' => 'name',
  77. 'result' => 'id',
  78. ),
  79. 'list' => '{task_id} > 0 ? Dever::load("task/info-one#name", {task_id}) : "系统"',
  80. ),
  81. 'company_id' => array
  82. (
  83. 'type' => 'int-11',
  84. 'name' => '商家',
  85. 'default' => '-1',
  86. 'desc' => '商家',
  87. 'match' => 'is_numeric',
  88. //'update' => 'select',
  89. 'search' => 'select',
  90. 'option' => $company,
  91. 'list' => true,
  92. ),
  93. 'cate_id' => array
  94. (
  95. 'type' => 'int-11',
  96. 'name' => '类别',
  97. 'default' => '-1',
  98. 'desc' => '类别',
  99. 'match' => 'is_numeric',
  100. //'update' => 'select',
  101. 'search' => 'select',
  102. 'option' => $cate,
  103. 'list' => true,
  104. ),
  105. 'status' => array
  106. (
  107. 'type' => 'tinyint-1',
  108. 'name' => '审核状态',
  109. 'default' => '1',
  110. 'desc' => '审核状态',
  111. 'match' => 'is_numeric',
  112. 'update' => 'select',
  113. 'option' => $status,
  114. 'search' => 'select',
  115. 'list' => true,
  116. 'edit' => true,
  117. ),
  118. 'state' => array
  119. (
  120. 'type' => 'tinyint-1',
  121. 'name' => '状态',
  122. 'default' => '1',
  123. 'desc' => '请选择状态',
  124. 'match' => 'is_numeric',
  125. ),
  126. 'cdate' => array
  127. (
  128. 'type' => 'int-11',
  129. 'name' => '领取时间',
  130. 'match' => array('is_numeric', time()),
  131. 'desc' => '',
  132. # 只有insert时才生效
  133. 'insert' => true,
  134. 'search' => 'date',
  135. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  136. ),
  137. ),
  138. 'manage' => array
  139. (
  140. 'insert' => false,
  141. 'edit' => false,
  142. 'delete' => false,
  143. ),
  144. );