action_log_finish.php 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
  1. <?php
  2. $action = function()
  3. {
  4. $array = array();
  5. $info = Dever::db('score/action')->state();
  6. if($info)
  7. {
  8. $array += $info;
  9. }
  10. return $array;
  11. };
  12. $score_type = array
  13. (
  14. 1 => '未加积分',
  15. 2 => '已加积分',
  16. 3 => '达到积分上限',
  17. );
  18. $cron_type = array
  19. (
  20. 1 => '未开始',
  21. 2 => '进行中',
  22. 3 => '已完成',
  23. );
  24. return array
  25. (
  26. # 表名
  27. 'name' => 'action_log_finish',
  28. # 显示给用户看的名称
  29. 'lang' => '积分行为日志-已完成',
  30. 'order' => 10,
  31. 'menu' => false,
  32. # 数据结构
  33. 'struct' => array
  34. (
  35. 'id' => array
  36. (
  37. 'type' => 'int-11',
  38. 'name' => 'ID',
  39. 'default' => '',
  40. 'desc' => '',
  41. 'match' => 'is_numeric',
  42. //'list' => true,
  43. ),
  44. 'log_id' => array
  45. (
  46. 'type' => 'int-11',
  47. 'name' => 'ID',
  48. 'default' => '',
  49. 'desc' => '',
  50. 'match' => 'is_numeric',
  51. 'list' => true,
  52. ),
  53. 'uid' => array
  54. (
  55. 'type' => 'int-11',
  56. 'name' => '用户名',
  57. 'default' => '0',
  58. 'desc' => '请选择用户',
  59. 'match' => 'is_numeric',
  60. //'update' => 'select',
  61. //'search' => 'select',
  62. 'search' => array
  63. (
  64. 'api' => 'passport/user-all',
  65. 'col' => 'username',
  66. 'result' => 'id',
  67. ),
  68. 'list' => '{uid} > 0 ? Dever::load("passport/user-one#username", {uid}) : "匿名用户"',
  69. ),
  70. 'parent_uid' => array
  71. (
  72. 'type' => 'int-11',
  73. 'name' => '上级用户',
  74. 'default' => '0',
  75. 'desc' => '请选择上级用户',
  76. 'match' => 'is_numeric',
  77. 'list' => true,
  78. ),
  79. 'action_id' => array
  80. (
  81. 'type' => 'int-11',
  82. 'name' => '所属行为',
  83. 'default' => '1',
  84. 'desc' => '所属行为',
  85. 'match' => 'is_numeric',
  86. 'update' => 'select',
  87. 'option' => $action,
  88. 'search' => 'select',
  89. 'list' => true,
  90. ),
  91. 'type' => array
  92. (
  93. 'type' => 'varchar-32',
  94. 'name' => '所属数据源',
  95. 'default' => '',
  96. 'desc' => '所属数据源',
  97. 'match' => 'is_string',
  98. //'list' => true,
  99. ),
  100. 'type_id' => array
  101. (
  102. 'type' => 'int-11',
  103. 'name' => '数据源id',
  104. 'default' => '',
  105. 'desc' => '数据源id',
  106. 'match' => 'is_numeric',
  107. //'list' => true,
  108. ),
  109. 'score_type' => array
  110. (
  111. 'type' => 'int-11',
  112. 'name' => '是否增加积分',
  113. 'default' => '1',
  114. 'desc' => '是否增加积分',
  115. 'match' => 'is_numeric',
  116. 'update' => 'select',
  117. 'option' => $score_type,
  118. 'search' => 'select',
  119. 'list' => true,
  120. ),
  121. 'cron_type' => array
  122. (
  123. 'type' => 'int-11',
  124. 'name' => '状态',
  125. 'default' => '3',
  126. 'desc' => '状态',
  127. 'match' => 'is_numeric',
  128. 'update' => 'select',
  129. 'option' => $cron_type,
  130. 'search' => 'select',
  131. 'list' => true,
  132. ),
  133. 'score' => array
  134. (
  135. 'type' => 'varchar-30',
  136. 'name' => '增加积分数',
  137. 'default' => '0',
  138. 'desc' => '积分数',
  139. 'match' => 'is_string',
  140. 'list' => true,
  141. ),
  142. 'num' => array
  143. (
  144. 'type' => 'varchar-30',
  145. 'name' => '增加的积分将乘以该数量',
  146. 'default' => '0',
  147. 'desc' => '积分数',
  148. 'match' => 'is_string',
  149. ),
  150. 'mscore' => array
  151. (
  152. 'type' => 'varchar-30',
  153. 'name' => '手动增加积分数',
  154. 'default' => '0',
  155. 'desc' => '积分数',
  156. 'match' => 'is_string',
  157. ),
  158. 'callback' => array
  159. (
  160. 'type' => 'varchar-800',
  161. 'name' => '行为回调方法',
  162. 'default' => '',
  163. 'desc' => '行为回调方法',
  164. 'match' => 'option',
  165. 'update' => 'textarea',
  166. //'list' => true,
  167. ),
  168. 'cdate' => array
  169. (
  170. 'type' => 'int-11',
  171. 'name' => '录入时间',
  172. 'match' => array('is_numeric', time()),
  173. 'desc' => '',
  174. # 只有insert时才生效
  175. 'insert' => true,
  176. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  177. ),
  178. ),
  179. # 索引
  180. 'index' => array
  181. (
  182. 1 => array
  183. (
  184. 'search' => 'uid,action_id,cron_type',
  185. ),
  186. # 版本号 更改版本号会更新当前表的索引
  187. 'version' => 1,
  188. ),
  189. 'manage' => array
  190. (
  191. 'delete' => false,
  192. 'edit' => false,
  193. 'insert' => false,
  194. ),
  195. # request 请求接口定义
  196. 'request' => array
  197. (
  198. 'getDataByDate' => array
  199. (
  200. # 匹配的正则或函数 选填项
  201. 'option' => array
  202. (
  203. 'start' => array('yes-cdate', '>='),
  204. 'end' => array('yes-cdate', '<='),
  205. 'score_type' => 'yes',
  206. 'action_id' => 'yes',
  207. ),
  208. 'type' => 'all',
  209. 'order' => array('id' => 'desc'),
  210. 'col' => 'id',
  211. ),
  212. )
  213. );