user_score_log.php 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242
  1. <?php
  2. $status = array
  3. (
  4. 1 => '支出',
  5. 2 => '收入',
  6. );
  7. $cash_type = array
  8. (
  9. 1 => '微信',
  10. 2 => '支付宝',
  11. );
  12. //后台只显示
  13. $type = array
  14. (
  15. //1 => '积分兑现-申请',
  16. //2 => '积分兑现-完成',
  17. //3 => '积分兑现-失败',
  18. 4 => '任务奖励',
  19. 5 => '任务提成',
  20. //6 => '系统奖励',
  21. );
  22. return array
  23. (
  24. # 表名
  25. 'name' => 'user_score_log',
  26. # 显示给用户看的名称
  27. 'lang' => '用户积分日志',
  28. 'menu' => false,
  29. 'order' => 19,
  30. # 数据结构
  31. 'struct' => array
  32. (
  33. 'id' => array
  34. (
  35. 'type' => 'int-11',
  36. 'name' => 'ID',
  37. 'default' => '',
  38. 'desc' => '',
  39. 'match' => 'is_numeric',
  40. //'search' => 'order',
  41. 'order' => 'desc',
  42. 'list' => true,
  43. ),
  44. 'uid' => array
  45. (
  46. 'type' => 'int-11',
  47. 'name' => '用户名',
  48. 'default' => '',
  49. 'desc' => '用户名',
  50. 'match' => 'is_numeric',
  51. //'update' => 'text',
  52. 'search' => array
  53. (
  54. 'api' => 'passport/user-all',
  55. 'col' => 'username',
  56. 'result' => 'id',
  57. ),
  58. 'list' => 'Dever::load("passport/user-one#username", {uid})',
  59. ),
  60. 'group_uid' => array
  61. (
  62. 'type' => 'int-11',
  63. 'name' => '下线用户名',
  64. 'default' => '',
  65. 'desc' => '下线用户名',
  66. 'match' => 'is_numeric',
  67. ),
  68. 'score' => array
  69. (
  70. 'type' => 'varchar-11',
  71. 'name' => '积分',
  72. 'default' => '',
  73. 'desc' => '积分',
  74. 'match' => 'is_numeric',
  75. 'update' => 'text',
  76. 'list' => true,
  77. ),
  78. 'cash' => array
  79. (
  80. 'type' => 'varchar-11',
  81. 'name' => '兑换现金',
  82. 'default' => '',
  83. 'desc' => '兑换现金',
  84. 'match' => 'is_numeric',
  85. 'update' => 'text',
  86. ),
  87. 'task_id' => array
  88. (
  89. 'type' => 'int-11',
  90. 'name' => '任务名',
  91. 'default' => '-1',
  92. 'desc' => '任务名',
  93. 'match' => 'is_numeric',
  94. //'update' => 'select',
  95. 'search' => array
  96. (
  97. 'api' => 'task/info-all',
  98. 'col' => 'name',
  99. 'result' => 'id',
  100. ),
  101. 'list' => '{task_id} > 0 ? Dever::load("task/info-one#name", {task_id}) : "系统"',
  102. ),
  103. 'report_id' => array
  104. (
  105. 'type' => 'int-11',
  106. 'name' => '报告',
  107. 'default' => '-1',
  108. 'desc' => '报告',
  109. 'match' => 'is_numeric',
  110. ),
  111. 'type' => array
  112. (
  113. 'type' => 'tinyint-1',
  114. 'name' => '积分类型',
  115. 'default' => '1',
  116. 'desc' => '积分类型',
  117. 'match' => 'is_numeric',
  118. 'update' => 'select',
  119. 'option' => $type,
  120. 'search' => 'select',
  121. 'list' => true,
  122. //'edit' => true,
  123. ),
  124. 'type_desc' => array
  125. (
  126. 'type' => 'varchar-300',
  127. 'name' => '积分类型描述',
  128. 'default' => '',
  129. 'desc' => '请输入积分类型描述',
  130. 'match' => 'option',
  131. 'update' => 'textarea',
  132. ),
  133. 'cash_type' => array
  134. (
  135. 'type' => 'tinyint-1',
  136. 'name' => '兑现途径',
  137. 'default' => '1',
  138. 'desc' => '兑现途径',
  139. 'match' => 'is_numeric',
  140. 'update' => 'select',
  141. //'option' => $cash_type,
  142. //'search' => 'select',
  143. //'list' => true,
  144. ),
  145. 'status' => array
  146. (
  147. 'type' => 'tinyint-1',
  148. 'name' => '收入支出状态',
  149. 'default' => '1',
  150. 'desc' => '收入支出状态',
  151. 'match' => 'is_numeric',
  152. 'update' => 'select',
  153. 'option' => $status,
  154. //'search' => 'select',
  155. 'list' => true,
  156. //'edit' => true,
  157. ),
  158. 'state' => array
  159. (
  160. 'type' => 'tinyint-1',
  161. 'name' => '状态',
  162. 'default' => '1',
  163. 'desc' => '请选择状态',
  164. 'match' => 'is_numeric',
  165. ),
  166. 'cash_date' => array
  167. (
  168. 'type' => 'int-11',
  169. 'name' => '申请兑现时间',
  170. 'default' => '',
  171. 'match' => 'is_numeric',
  172. 'desc' => '申请兑现时间',
  173. ),
  174. 'cdate' => array
  175. (
  176. 'type' => 'int-11',
  177. 'name' => '入库时间',
  178. 'match' => array('is_numeric', time()),
  179. 'desc' => '',
  180. # 只有insert时才生效
  181. 'insert' => true,
  182. 'search' => 'date',
  183. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  184. ),
  185. ),
  186. # 更新表结构
  187. 'alter' => array
  188. (
  189. 1 => array
  190. (
  191. array('update', 'score', 'score', 'varchar-11 0 积分'),
  192. array('update', 'cash', 'cash', 'varchar-11 0 兑换金额'),
  193. ),
  194. 'version' => 1,
  195. ),
  196. 'manage' => array
  197. (
  198. 'insert' => false,
  199. 'edit' => false,
  200. 'delete' => false,
  201. ),
  202. 'request' => array
  203. (
  204. 'getAll' => array
  205. (
  206. # 匹配的正则或函数 选填项
  207. 'option' => array
  208. (
  209. 'uid' => 'yes',
  210. 'task_id' => 'yes',
  211. 'report_id' => 'yes',
  212. 'status' => 'yes',
  213. 'type' => 'yes',
  214. 'state' => 1,
  215. ),
  216. 'type' => 'all',
  217. 'order' => array('cdate' => 'desc'),
  218. 'col' => '*',
  219. ),
  220. )
  221. );