action_log.php 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  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. return array
  19. (
  20. # 表名
  21. 'name' => 'action_log',
  22. # 显示给用户看的名称
  23. 'lang' => '积分行为日志',
  24. 'order' => 10,
  25. 'menu' => false,
  26. # 数据结构
  27. 'struct' => array
  28. (
  29. 'id' => array
  30. (
  31. 'type' => 'int-11',
  32. 'name' => 'ID',
  33. 'default' => '',
  34. 'desc' => '',
  35. 'match' => 'is_numeric',
  36. ),
  37. 'uid' => array
  38. (
  39. 'type' => 'int-11',
  40. 'name' => '用户名',
  41. 'default' => '0',
  42. 'desc' => '请选择用户',
  43. 'match' => 'is_numeric',
  44. //'update' => 'select',
  45. //'search' => 'select',
  46. 'search' => array
  47. (
  48. 'api' => 'passport/user-all',
  49. 'col' => 'username',
  50. 'result' => 'id',
  51. ),
  52. 'list' => '{uid} > 0 ? Dever::load("passport/user-one#username", {uid}) : "匿名用户"',
  53. ),
  54. 'action_id' => array
  55. (
  56. 'type' => 'int-11',
  57. 'name' => '所属行为',
  58. 'default' => '1',
  59. 'desc' => '所属行为',
  60. 'match' => 'is_numeric',
  61. 'update' => 'select',
  62. 'option' => $action,
  63. 'search' => 'select',
  64. 'list' => true,
  65. ),
  66. 'score_type' => array
  67. (
  68. 'type' => 'int-11',
  69. 'name' => '是否增加积分',
  70. 'default' => '1',
  71. 'desc' => '是否增加积分',
  72. 'match' => 'is_numeric',
  73. 'update' => 'select',
  74. 'option' => $score_type,
  75. 'search' => 'select',
  76. 'list' => true,
  77. ),
  78. 'score' => array
  79. (
  80. 'type' => 'varchar-30',
  81. 'name' => '增加积分数',
  82. 'default' => '0',
  83. 'desc' => '积分数',
  84. 'match' => 'is_string',
  85. 'list' => true,
  86. ),
  87. 'num' => array
  88. (
  89. 'type' => 'varchar-30',
  90. 'name' => '增加的积分将乘以该数量',
  91. 'default' => '0',
  92. 'desc' => '积分数',
  93. 'match' => 'is_string',
  94. ),
  95. 'mscore' => array
  96. (
  97. 'type' => 'varchar-30',
  98. 'name' => '手动增加积分数',
  99. 'default' => '0',
  100. 'desc' => '积分数',
  101. 'match' => 'is_string',
  102. ),
  103. 'callback' => array
  104. (
  105. 'type' => 'varchar-800',
  106. 'name' => '行为回调方法',
  107. 'default' => '',
  108. 'desc' => '行为回调方法',
  109. 'match' => 'option',
  110. 'update' => 'textarea',
  111. //'list' => true,
  112. ),
  113. 'cdate' => array
  114. (
  115. 'type' => 'int-11',
  116. 'name' => '录入时间',
  117. 'match' => array('is_numeric', time()),
  118. 'desc' => '',
  119. # 只有insert时才生效
  120. 'insert' => true,
  121. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  122. ),
  123. ),
  124. 'manage' => array
  125. (
  126. 'delete' => false,
  127. 'edit' => false,
  128. 'insert' => false,
  129. ),
  130. );