user_score.php 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. <?php
  2. return array
  3. (
  4. # 表名
  5. 'name' => 'user_score',
  6. # 显示给用户看的名称
  7. 'lang' => '用户积分',
  8. 'menu' => 'passport',
  9. 'order' => 19,
  10. # 数据结构
  11. 'struct' => array
  12. (
  13. 'id' => array
  14. (
  15. 'type' => 'int-11',
  16. 'name' => 'ID',
  17. 'default' => '',
  18. 'desc' => '',
  19. 'match' => 'is_numeric',
  20. //'search' => 'order',
  21. 'order' => 'desc',
  22. 'list' => true,
  23. ),
  24. 'uid' => array
  25. (
  26. 'type' => 'int-11',
  27. 'name' => '用户名',
  28. 'default' => '',
  29. 'desc' => '用户名',
  30. 'match' => 'is_numeric',
  31. //'update' => 'text',
  32. 'search' => array
  33. (
  34. 'api' => 'passport/user-all',
  35. 'col' => 'username',
  36. 'result' => 'id',
  37. ),
  38. 'list' => 'Dever::load("passport/user-one#username", {uid})',
  39. ),
  40. 'score' => array
  41. (
  42. 'type' => 'int-11',
  43. 'name' => '可用积分',
  44. 'default' => '0',
  45. 'desc' => '可用积分',
  46. 'match' => 'is_numeric',
  47. 'update' => 'text',
  48. 'list' => true,
  49. ),
  50. 'code' => array
  51. (
  52. 'type' => 'varchar-50',
  53. 'name' => '邀请码',
  54. 'default' => '0',
  55. 'desc' => '邀请码',
  56. 'match' => 'is_string',
  57. 'update' => 'text',
  58. //'list' => true,
  59. ),
  60. 'state' => array
  61. (
  62. 'type' => 'tinyint-1',
  63. 'name' => '状态',
  64. 'default' => '1',
  65. 'desc' => '请选择状态',
  66. 'match' => 'is_numeric',
  67. ),
  68. 'cdate' => array
  69. (
  70. 'type' => 'int-11',
  71. 'name' => '入库时间',
  72. 'match' => array('is_numeric', time()),
  73. 'desc' => '',
  74. # 只有insert时才生效
  75. 'insert' => true,
  76. 'search' => 'date',
  77. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  78. ),
  79. ),
  80. 'manage' => array
  81. (
  82. 'insert' => false,
  83. 'edit' => false,
  84. 'delete' => false,
  85. # 列表
  86. 'list_button' => array
  87. (
  88. 'list' => array('积分日志', '"user_score_log&project=task&search_option_uid={uid}&search_option_status=2&oper_parent=user_score&oper_project=task"'),
  89. ),
  90. ),
  91. 'request' => array
  92. (
  93. 'updateScore' => array
  94. (
  95. # 匹配的正则或函数 选填项
  96. 'where' => array
  97. (
  98. 'uid' => 'yes',
  99. ),
  100. 'set' => array
  101. (
  102. 'score' => array('yes', '+='),
  103. ),
  104. 'type' => 'update',
  105. ),
  106. )
  107. );