user.php 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. <?php
  2. $config = function()
  3. {
  4. $array = array();
  5. $info = Dever::db('score/config')->state();
  6. if($info)
  7. {
  8. $array += $info;
  9. }
  10. return $array;
  11. };
  12. return array
  13. (
  14. # 表名
  15. 'name' => 'user',
  16. # 显示给用户看的名称
  17. 'lang' => '用户积分列表',
  18. 'order' => 100,
  19. 'menu' => 'passport',
  20. # 数据结构
  21. 'struct' => array
  22. (
  23. 'id' => array
  24. (
  25. 'type' => 'int-11',
  26. 'name' => 'ID',
  27. 'default' => '',
  28. 'desc' => '',
  29. 'match' => 'is_numeric',
  30. 'list' => true,
  31. ),
  32. 'uid' => array
  33. (
  34. 'type' => 'int-11',
  35. 'name' => '用户名',
  36. 'default' => '0',
  37. 'desc' => '请选择用户',
  38. 'match' => 'is_numeric',
  39. //'update' => 'select',
  40. //'search' => 'select',
  41. 'search' => array
  42. (
  43. 'api' => 'passport/user-all',
  44. 'col' => 'username',
  45. 'result' => 'id',
  46. ),
  47. 'list' => '{uid} > 0 ? Dever::load("passport/user-one#username", {uid}) : "匿名用户"',
  48. ),
  49. 'config_id' => array
  50. (
  51. 'type' => 'int-11',
  52. 'name' => '积分名称',
  53. 'default' => '1',
  54. 'desc' => '积分名称',
  55. 'match' => 'is_numeric',
  56. 'update' => 'select',
  57. 'option' => $config,
  58. 'search' => 'select',
  59. 'list' => true,
  60. ),
  61. 'score' => array
  62. (
  63. 'type' => 'varchar-80',
  64. 'name' => '可用数量',
  65. 'default' => '0',
  66. 'desc' => '可用数量',
  67. 'match' => 'option',
  68. 'update' => 'text',
  69. 'search' => 'order',
  70. 'list' => true,
  71. ),
  72. 'no_score' => array
  73. (
  74. 'type' => 'varchar-80',
  75. 'name' => '冻结数量',
  76. 'default' => '0',
  77. 'desc' => '冻结数量',
  78. 'match' => 'option',
  79. 'update' => 'text',
  80. 'search' => 'order',
  81. 'list' => true,
  82. ),
  83. 'cdate' => array
  84. (
  85. 'type' => 'int-11',
  86. 'name' => '录入时间',
  87. 'match' => array('is_numeric', time()),
  88. 'desc' => '',
  89. # 只有insert时才生效
  90. 'insert' => true,
  91. ),
  92. ),
  93. 'manage' => array
  94. (
  95. 'delete' => false,
  96. 'edit' => false,
  97. 'insert' => false,
  98. # 列表
  99. 'list_button' => array
  100. (
  101. 'list' => array('积分日志', '"user_log&search_option_uid={uid}&oper_parent=user"'),
  102. ),
  103. ),
  104. # request 请求接口定义
  105. 'request' => array
  106. (
  107. 'getScoreByConfig' => array
  108. (
  109. # 匹配的正则或函数 选填项
  110. 'option' => array
  111. (
  112. 'uid' => 'yes',
  113. ),
  114. 'type' => 'all',
  115. 'order' => array('id' => 'desc'),
  116. 'col' => 'uid,config_id,score|config_id',
  117. ),
  118. )
  119. );