role_reward.php 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  1. <?php
  2. $role = function()
  3. {
  4. $info = Dever::db('setting/role')->select();
  5. return $info;
  6. };
  7. $value_type = array
  8. (
  9. 1 => '百分比',
  10. 2 => '数值',
  11. );
  12. $is_give = array
  13. (
  14. 1 => '是',
  15. 2 => '否',
  16. );
  17. $prize = function()
  18. {
  19. $info = Dever::db('setting/prize')->select();
  20. return $info;
  21. };
  22. $role_id = Dever::input('search_option_role_id');
  23. $update = false;
  24. if ($role_id) {
  25. $role_info = Dever::db('setting/role')->find($role_id);
  26. if ($role_info && $role_info['type'] == 2 && $role_info['area'] < 3) {
  27. $update = 'text';
  28. }
  29. }
  30. return array
  31. (
  32. # 表名
  33. 'name' => 'role_reward',
  34. # 显示给用户看的名称
  35. 'lang' => '奖励管理',
  36. 'menu' => false,
  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' => $role_id,
  61. 'list' => 'Dever::load("setting/role-one#name", {role_id})',
  62. ),
  63. 't_role_id' => array
  64. (
  65. 'type' => 'int-11',
  66. 'name' => '推荐角色',
  67. 'default' => '',
  68. 'desc' => '推荐角色',
  69. 'match' => 'is_numeric',
  70. 'update' => 'select',
  71. 'search' => 'select',
  72. 'option' => $role,
  73. 'list' => 'Dever::load("setting/role-one#name", {t_role_id})',
  74. ),
  75. 'num' => array
  76. (
  77. 'type' => 'int-11',
  78. 'name' => '推荐个数-每推荐多少个,奖励多少数值,这里填写推荐个数',
  79. 'default' => '1',
  80. 'desc' => '推荐个数',
  81. 'match' => 'is_numeric',
  82. 'update' => 'text',
  83. 'list' => true,
  84. ),
  85. 'value' => array
  86. (
  87. 'type' => 'varchar-32',
  88. 'name' => '推荐奖励数值-如果是百分比,这里输入10,就是奖励10%,如果是数值,这里以元为单位',
  89. 'default' => '0',
  90. 'desc' => '推荐奖励数值',
  91. 'match' => 'is_string',
  92. 'update' => 'text',
  93. 'search' => 'fulltext',
  94. 'list' => true,
  95. ),
  96. 'zt_qn_value' => array
  97. (
  98. 'type' => 'varchar-32',
  99. 'name' => '直推区内数值-规则同上,仅限区县和城市代理有效',
  100. 'default' => '0',
  101. 'desc' => '直推区内数值',
  102. 'match' => 'is_string',
  103. 'update' => $update,
  104. //'search' => 'fulltext',
  105. //'list' => true,
  106. ),
  107. 'zt_qw_value' => array
  108. (
  109. 'type' => 'varchar-32',
  110. 'name' => '直推区外数值-规则同上,仅限区县和城市代理有效',
  111. 'default' => '0',
  112. 'desc' => '直推区外数值',
  113. 'match' => 'is_string',
  114. 'update' => $update,
  115. //'search' => 'fulltext',
  116. //'list' => true,
  117. ),
  118. 'fzt_qn_value' => array
  119. (
  120. 'type' => 'varchar-32',
  121. 'name' => '非直推区内数值-规则同上,仅限区县和城市代理有效,如果是城市代理,这里可以填写两个数值,用半角逗号隔开,第一个是区县数值,第二个是街道数值',
  122. 'default' => '0',
  123. 'desc' => '非直推区内数值',
  124. 'match' => 'is_string',
  125. 'update' => $update,
  126. //'search' => 'fulltext',
  127. //'list' => true,
  128. ),
  129. 'value_type' => array
  130. (
  131. 'type' => 'tinyint-1',
  132. 'name' => '奖励数值类型',
  133. 'default' => '1',
  134. 'desc' => '奖励数值类型',
  135. 'match' => 'is_numeric',
  136. 'update' => 'radio',
  137. 'option' => $value_type,
  138. 'search' => 'select',
  139. 'list' => true,
  140. 'control' => 'type',
  141. ),
  142. 'is_give' => array
  143. (
  144. 'type' => 'tinyint-1',
  145. 'name' => '是否有额外奖励',
  146. 'default' => '2',
  147. 'desc' => '是否有额外奖励',
  148. 'match' => 'is_numeric',
  149. 'update' => 'radio',
  150. 'option' => $is_give,
  151. 'control' => 'is_give',
  152. ),
  153. 'give' => array
  154. (
  155. 'type' => 'text-1000',
  156. 'name' => '额外奖励',
  157. 'default' => '',
  158. 'desc' => '额外奖励',
  159. 'match' => 'is_string',
  160. 'show' => 'is_give=1',
  161. 'update' => array
  162. (
  163. array
  164. (
  165. 'col' => 'num',
  166. 'name' => '推荐个数',
  167. 'default' => '0',
  168. 'desc' => '推荐个数',
  169. 'match' => 'is_string',
  170. 'update' => 'text',
  171. ),
  172. array
  173. (
  174. 'col' => 'type',
  175. 'name' => '奖励类型',
  176. 'default' => '1',
  177. 'desc' => '奖励类型',
  178. 'match' => 'is_string',
  179. 'update' => 'select',
  180. 'option' => $prize,
  181. ),
  182. ),
  183. ),
  184. 'state' => array
  185. (
  186. 'type' => 'tinyint-1',
  187. 'name' => '状态',
  188. 'default' => '1',
  189. 'desc' => '请选择状态',
  190. 'match' => 'is_numeric',
  191. ),
  192. 'cdate' => array
  193. (
  194. 'type' => 'int-11',
  195. 'name' => '创建时间',
  196. 'match' => array('is_numeric', time()),
  197. 'desc' => '',
  198. # 只有insert时才生效
  199. //'insert' => true,
  200. 'search' => 'date',
  201. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  202. ),
  203. ),
  204. 'manage' => array
  205. (
  206. ),
  207. 'request' => array
  208. (
  209. ),
  210. );