info.php 2.6 KB

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