role_goods.php 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. <?php
  2. $role = function()
  3. {
  4. $info = Dever::db('setting/role')->select();
  5. return $info;
  6. };
  7. $give = array
  8. (
  9. 1 => '新购赠送',
  10. 2 => '升级赠送',
  11. );
  12. $type = array
  13. (
  14. 1 => '商品',
  15. 2 => '体验卡',
  16. 3 => '名额',
  17. );
  18. $prize = array
  19. (
  20. 1 => '九阳自动炒菜机套餐名额',
  21. 2 => '二级街道代理商名额',
  22. 3 => '60%分润创客名额',
  23. );
  24. return array
  25. (
  26. # 表名
  27. 'name' => 'role_goods',
  28. # 显示给用户看的名称
  29. 'lang' => '权益设置',
  30. 'menu' => false,
  31. 'set' => array
  32. (
  33. 'give' => $give,
  34. 'type' => $type,
  35. 'prize' => $prize,
  36. ),
  37. # 数据结构
  38. 'struct' => array
  39. (
  40. 'id' => array
  41. (
  42. 'type' => 'int-11',
  43. 'name' => 'ID',
  44. 'default' => '',
  45. 'desc' => '',
  46. 'match' => 'is_numeric',
  47. 'search' => 'order',
  48. 'update' => 'hidden',
  49. //'list' => true,
  50. ),
  51. 'role_id' => array
  52. (
  53. 'type' => 'int-11',
  54. 'name' => '代理商角色',
  55. 'default' => '',
  56. 'desc' => '代理商角色',
  57. 'match' => 'is_numeric',
  58. 'update' => 'hidden',
  59. 'search' => 'hidden',
  60. 'value' => Dever::input('search_option_role_id'),
  61. 'list' => 'Dever::load("setting/role-one#name", {role_id})',
  62. ),
  63. 'give' => array
  64. (
  65. 'type' => 'tinyint-1',
  66. 'name' => '赠送',
  67. 'default' => '1',
  68. 'desc' => '赠送',
  69. 'match' => 'is_numeric',
  70. 'update' => 'radio',
  71. 'option' => $give,
  72. ),
  73. 'type' => array
  74. (
  75. 'type' => 'tinyint-1',
  76. 'name' => '类型',
  77. 'default' => '1',
  78. 'desc' => '类型',
  79. 'match' => 'is_numeric',
  80. 'update' => 'radio',
  81. 'option' => $type,
  82. ),
  83. 'type_id' => array
  84. (
  85. 'type' => 'int-11',
  86. 'name' => '类型id',
  87. 'default' => '-1',
  88. 'desc' => '类型id',
  89. 'match' => 'is_numeric',
  90. ),
  91. 'sku_id' => array
  92. (
  93. 'type' => 'int-11',
  94. 'name' => 'sku_id',
  95. 'default' => '-1',
  96. 'desc' => 'sku_id',
  97. 'match' => 'is_numeric',
  98. ),
  99. 'num' => array
  100. (
  101. 'type' => 'int-11',
  102. 'name' => '数量',
  103. 'default' => '',
  104. 'desc' => '数量',
  105. 'match' => 'is_numeric',
  106. 'search' => 'select',
  107. 'list' => true,
  108. ),
  109. 'state' => array
  110. (
  111. 'type' => 'tinyint-1',
  112. 'name' => '状态',
  113. 'default' => '1',
  114. 'desc' => '请选择状态',
  115. 'match' => 'is_numeric',
  116. ),
  117. 'cdate' => array
  118. (
  119. 'type' => 'int-11',
  120. 'name' => '创建时间',
  121. 'match' => array('is_numeric', time()),
  122. 'desc' => '',
  123. # 只有insert时才生效
  124. //'insert' => true,
  125. 'search' => 'date',
  126. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  127. ),
  128. ),
  129. 'manage' => array
  130. (
  131. ),
  132. 'request' => array
  133. (
  134. 'getData' => array
  135. (
  136. # 匹配的正则或函数 选填项
  137. 'option' => array
  138. (
  139. 'role_id' => 'yes',
  140. 'give' => 'yes',
  141. 'config' => 'yes',
  142. 'state' => 1,
  143. ),
  144. 'order' => array('type' => 'asc', 'id' => 'desc'),
  145. 'type' => 'all',
  146. 'col' => '*',
  147. ),
  148. ),
  149. );