prize_goods.php 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. <?php
  2. $role = function()
  3. {
  4. $info = Dever::db('setting/role')->select();
  5. return $info;
  6. };
  7. $type = array
  8. (
  9. 1 => '商品',
  10. 2 => '礼品卡',
  11. );
  12. return array
  13. (
  14. # 表名
  15. 'name' => 'prize_goods',
  16. # 显示给用户看的名称
  17. 'lang' => '名额权益设置',
  18. 'menu' => false,
  19. 'set' => array
  20. (
  21. 'type' => $type,
  22. ),
  23. # 数据结构
  24. 'struct' => array
  25. (
  26. 'id' => array
  27. (
  28. 'type' => 'int-11',
  29. 'name' => 'ID',
  30. 'default' => '',
  31. 'desc' => '',
  32. 'match' => 'is_numeric',
  33. 'search' => 'order',
  34. 'update' => 'hidden',
  35. //'list' => true,
  36. ),
  37. 'prize_id' => array
  38. (
  39. 'type' => 'int-11',
  40. 'name' => '名额',
  41. 'default' => '',
  42. 'desc' => '名额',
  43. 'match' => 'is_numeric',
  44. 'update' => 'hidden',
  45. 'search' => 'hidden',
  46. 'value' => Dever::input('search_option_prize_id'),
  47. 'list' => 'Dever::load("setting/prize-one#name", {prize_id})',
  48. ),
  49. 'type' => array
  50. (
  51. 'type' => 'tinyint-1',
  52. 'name' => '类型',
  53. 'default' => '1',
  54. 'desc' => '类型',
  55. 'match' => 'is_numeric',
  56. 'update' => 'radio',
  57. 'option' => $type,
  58. ),
  59. 'type_id' => array
  60. (
  61. 'type' => 'int-11',
  62. 'name' => '类型id',
  63. 'default' => '-1',
  64. 'desc' => '类型id',
  65. 'match' => 'is_numeric',
  66. ),
  67. 'sku_id' => array
  68. (
  69. 'type' => 'int-11',
  70. 'name' => 'sku_id',
  71. 'default' => '-1',
  72. 'desc' => 'sku_id',
  73. 'match' => 'is_numeric',
  74. ),
  75. 'num' => array
  76. (
  77. 'type' => 'int-11',
  78. 'name' => '数量',
  79. 'default' => '',
  80. 'desc' => '数量',
  81. 'match' => 'is_numeric',
  82. 'search' => 'select',
  83. 'list' => true,
  84. ),
  85. 'state' => array
  86. (
  87. 'type' => 'tinyint-1',
  88. 'name' => '状态',
  89. 'default' => '1',
  90. 'desc' => '请选择状态',
  91. 'match' => 'is_numeric',
  92. ),
  93. 'cdate' => array
  94. (
  95. 'type' => 'int-11',
  96. 'name' => '创建时间',
  97. 'match' => array('is_numeric', time()),
  98. 'desc' => '',
  99. # 只有insert时才生效
  100. //'insert' => true,
  101. 'search' => 'date',
  102. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  103. ),
  104. ),
  105. 'manage' => array
  106. (
  107. ),
  108. 'request' => array
  109. (
  110. 'getData' => array
  111. (
  112. # 匹配的正则或函数 选填项
  113. 'option' => array
  114. (
  115. 'prize_id' => 'yes',
  116. 'state' => 1,
  117. ),
  118. 'order' => array('type' => 'desc', 'id' => 'desc'),
  119. 'type' => 'all',
  120. 'col' => '*',
  121. ),
  122. ),
  123. );