info.php 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. <?php
  2. # 定义几个常用的选项
  3. $type = array
  4. (
  5. 1 => '未领取',
  6. 2 => '已领取',
  7. 3 => '已使用',
  8. );
  9. $product = Dever::load('journal/api.data');
  10. return array
  11. (
  12. # 表名
  13. 'name' => 'info',
  14. # 显示给用户看的名称
  15. 'lang' => '兑换码列表',
  16. 'menu' => 'journal',
  17. 'order' => 1,
  18. # 数据结构
  19. 'struct' => array
  20. (
  21. 'id' => array
  22. (
  23. 'type' => 'int-11',
  24. 'name' => 'ID',
  25. 'default' => '',
  26. 'desc' => '',
  27. 'match' => 'is_numeric',
  28. 'search' => 'order',
  29. //'list' => true,
  30. ),
  31. 'product_id' => array
  32. (
  33. 'type' => 'int-11',
  34. 'name' => '小刊',
  35. 'default' => '',
  36. 'desc' => '小刊',
  37. 'match' => 'is_numeric',
  38. 'update' => 'select',
  39. 'option' => $product,
  40. 'search' => 'select',
  41. 'list' => true,
  42. ),
  43. 'code' => array
  44. (
  45. 'type' => 'varchar-32',
  46. 'name' => '兑换码',
  47. 'default' => '',
  48. 'desc' => '兑换码',
  49. 'match' => 'is_string',
  50. 'update' => 'text',
  51. //'search' => 'fulltext',
  52. 'list' => true,
  53. ),
  54. 'product_num' => array
  55. (
  56. 'type' => 'int-11',
  57. 'name' => '兑换本数',
  58. 'default' => '1',
  59. 'desc' => '兑换本数',
  60. 'match' => 'option',
  61. 'update' => 'text',
  62. 'search' => 'fulltext',
  63. 'list' => true,
  64. ),
  65. 'type' => array
  66. (
  67. 'type' => 'int-11',
  68. 'name' => '使用状态',
  69. 'default' => '1',
  70. 'desc' => '使用状态',
  71. 'match' => 'is_numeric',
  72. 'option' => $type,
  73. 'search' => 'select',
  74. 'update' => 'select',
  75. 'list' => true,
  76. ),
  77. 'uid' => array
  78. (
  79. 'type' => 'int-11',
  80. 'name' => '用户信息',
  81. 'default' => '0',
  82. 'desc' => '用户信息',
  83. 'match' => 'is_numeric',
  84. //'list' => 'Dever::load("code/lib/manage.showUserInfo", "{uid}", "{ldate}")',
  85. ),
  86. 'state' => array
  87. (
  88. 'type' => 'tinyint-1',
  89. 'name' => '状态',
  90. 'default' => '1',
  91. 'desc' => '请选择状态',
  92. 'match' => 'is_numeric',
  93. ),
  94. 'ldate' => array
  95. (
  96. 'type' => 'int-11',
  97. 'name' => '领取时间',
  98. 'match' => 'option',
  99. 'default' => '',
  100. 'desc' => '',
  101. 'search' => 'date',
  102. ),
  103. 'cdate' => array
  104. (
  105. 'type' => 'int-11',
  106. 'name' => '生成时间',
  107. 'match' => array('is_numeric', time()),
  108. 'desc' => '',
  109. # 只有insert时才生效
  110. 'insert' => true,
  111. //'search' => 'date',
  112. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  113. ),
  114. ),
  115. 'manage' => array
  116. (
  117. 'excel' => true,
  118. 'delete' => false,
  119. 'edit' => false,
  120. 'insert' => false,
  121. # 自定义快捷新增和编辑
  122. 'button' => array
  123. (
  124. '新增兑换码' => array('fast', 1, 'config&where_id=1'),
  125. ),
  126. ),
  127. );