role_reward.php 7.1 KB

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