info.php 2.6 KB

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