role_goods.php 4.4 KB

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