role.php 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260
  1. <?php
  2. $type = array
  3. (
  4. 1 => '普通代理',
  5. 2 => '区域门店代理',
  6. 3 => '特殊代理',
  7. );
  8. $area = array
  9. (
  10. 1 => '城市',
  11. 2 => '区县',
  12. 3 => '街道',
  13. );
  14. $yes = array
  15. (
  16. 1 => '是',
  17. 2 => '否',
  18. );
  19. return array
  20. (
  21. # 表名
  22. 'name' => 'role',
  23. # 显示给用户看的名称
  24. 'lang' => '代理商角色',
  25. # 后台菜单排序
  26. 'order' => 2,
  27. 'config_type' => $type,
  28. # 数据结构
  29. 'struct' => array
  30. (
  31. 'id' => array
  32. (
  33. 'type' => 'int-11',
  34. 'name' => 'ID',
  35. 'default' => '',
  36. 'desc' => '',
  37. 'match' => 'is_numeric',
  38. 'search' => 'order',
  39. 'list' => true,
  40. 'order' => 'desc',
  41. ),
  42. 'name' => array
  43. (
  44. 'type' => 'varchar-200',
  45. 'name' => '名称',
  46. 'default' => '',
  47. 'desc' => '名称',
  48. 'match' => 'is_string',
  49. 'update' => 'text',
  50. 'search' => 'fulltext',
  51. 'list' => true,
  52. ),
  53. 'short_name' => array
  54. (
  55. 'type' => 'varchar-100',
  56. 'name' => '简称',
  57. 'default' => '',
  58. 'desc' => '简称',
  59. 'match' => 'is_string',
  60. 'update' => 'text',
  61. 'search' => 'fulltext',
  62. 'list' => true,
  63. ),
  64. 'desc' => array
  65. (
  66. 'type' => 'varchar-500',
  67. 'name' => '描述',
  68. 'default' => '',
  69. 'desc' => '描述',
  70. 'match' => 'is_string',
  71. 'update' => 'textarea',
  72. //'search' => 'fulltext',
  73. //'list' => true,
  74. ),
  75. 'type' => array
  76. (
  77. 'type' => 'tinyint-1',
  78. 'name' => '代理类型',
  79. 'default' => '1',
  80. 'desc' => '代理类型',
  81. 'match' => 'is_numeric',
  82. 'update' => 'radio',
  83. 'option' => $type,
  84. 'search' => 'select',
  85. 'list' => true,
  86. 'control' => 'type',
  87. ),
  88. 'area' => array
  89. (
  90. 'type' => 'tinyint-1',
  91. 'name' => '区域',
  92. 'default' => '-1',
  93. 'desc' => '区域',
  94. 'match' => 'is_numeric',
  95. //'update' => 'radio',
  96. 'option' => $area,
  97. 'show' => 'type=2',
  98. ),
  99. 'price' => array
  100. (
  101. 'type' => 'decimal-11,2',
  102. 'name' => '代理价格-以元为单位',
  103. 'default' => '0',
  104. 'desc' => '代理价格',
  105. 'match' => 'option',
  106. 'update' => 'text',
  107. //'list' => true,
  108. 'show' => 'type=1',
  109. ),
  110. 'soft' => array
  111. (
  112. 'type' => 'varchar-50',
  113. 'name' => '软件服务费-如果填写软件服务费,则代理商订单可以进行拆分,如带有%号,就表示是百分比,如10%',
  114. 'default' => '0',
  115. 'desc' => '软件服务费',
  116. 'match' => 'option',
  117. 'update' => 'text',
  118. ),
  119. 'profit' => array
  120. (
  121. 'type' => 'int-11',
  122. 'name' => '收益-区域内门店利润百分比,这里直接输入数字即可,如输入10,就是10%',
  123. 'default' => '0',
  124. 'desc' => '收益',
  125. 'match' => 'is_numeric',
  126. 'update' => 'text',
  127. 'show' => 'type=2',
  128. ),
  129. 'isbuy' => array
  130. (
  131. 'type' => 'tinyint-1',
  132. 'name' => '是否可购买-是否允许购买',
  133. 'default' => '1',
  134. 'desc' => '是否可购买',
  135. 'match' => 'is_numeric',
  136. 'update' => 'radio',
  137. 'option' => $yes,
  138. 'list' => true,
  139. ),
  140. 'levelup' => array
  141. (
  142. 'type' => 'tinyint-1',
  143. 'name' => '是否可升级-该角色是否可以升级到新角色',
  144. 'default' => '1',
  145. 'desc' => '是否可升级',
  146. 'match' => 'is_numeric',
  147. 'update' => 'radio',
  148. 'option' => $yes,
  149. 'list' => true,
  150. 'control' => 'levelup',
  151. ),
  152. 'levelup_yue' => array
  153. (
  154. 'type' => 'tinyint-1',
  155. 'name' => '升级补余额-升级到新角色,是否补足余额,如果选否,就直接用新角色全额购买',
  156. 'default' => '1',
  157. 'desc' => '升级补余额',
  158. 'match' => 'is_numeric',
  159. 'update' => 'radio',
  160. 'option' => $yes,
  161. 'show' => 'levelup=1',
  162. ),
  163. 'state' => array
  164. (
  165. 'type' => 'tinyint-1',
  166. 'name' => '状态',
  167. 'default' => '1',
  168. 'desc' => '请选择状态',
  169. 'match' => 'is_numeric',
  170. ),
  171. 'cdate' => array
  172. (
  173. 'type' => 'int-11',
  174. 'name' => '创建时间',
  175. 'match' => array('is_numeric', time()),
  176. 'desc' => '',
  177. # 只有insert时才生效
  178. 'insert' => true,
  179. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  180. ),
  181. ),
  182. 'alter' => array
  183. (
  184. 5 => array
  185. (
  186. array('update', 'price', 'price', 'decimal-11,2 0 代理价格'),
  187. ),
  188. 'version' => 5,
  189. ),
  190. 'default' => array
  191. (
  192. 'col' => 'id,name,short_name,`desc`,type,area,isbuy,levelup,levelup_yue,profit,price,state,cdate',
  193. 'value' => array
  194. (
  195. '1,"普通用户", "用户", "注册但未注册成功代理商角色的用户", 1, 1, 2, 2, 2, "0", "0", 1,' . DEVER_TIME,
  196. '2,"城市代理商", "城市", "一个城市代理商,有一二三线城市的区分。获得区域内门店利润1%收益。", 2, 1, 1, 2, 1, "1", "0", 1,' . DEVER_TIME,
  197. '3,"区县代理商", "区县", "一线城市的区,与二三线城市的县级代理商。获得区域内门店利润3%收益。", 2, 2, 1, 1, 1, "3", "0", 1,' . DEVER_TIME,
  198. '4,"街道代理商", "街道", "一个街道区域的代理商。获得区域内门店利润5%收益。", 2, 3, 1, 1, 1, "5", "0", 1,' . DEVER_TIME,
  199. '5,"创服代理商", "创服", "在开创本系统时的一个代理商角色,以后此角色不新增,要保留,因为其中还有一些权益未兑换。", 3, 1, 2, 1, 1, "0", "0", 1,' . DEVER_TIME,
  200. '6,"创客会员", "创客", "有分销能力的会员,但不产生代理商收益。", 1, 1, 1, 2, 2, "0", "5000", 1,' . DEVER_TIME,
  201. '7,"消客会员", "消客", "能带动产品销售量的会员。", 1, 1, 1, 2, 2, "0", "2000", 1,' . DEVER_TIME,
  202. ),
  203. ),
  204. 'manage' => array
  205. (
  206. //'insert' => false,
  207. 'delete' => false,
  208. 'edit' => false,
  209. 'list_button' => array
  210. (
  211. 'fast' => array('编辑', '"role&where_id={id}&oper_save_jump=role&oper_table=role&oper_parent=role&area={area}"'),
  212. 'list1' => array('推荐奖励', '"role_reward&search_option_role_id={id}&oper_table=role"'),
  213. //'list2' => array('商品权益', '"role_goods&search_option_role_id={id}&oper_table=role"'),
  214. 'location1' => array('权益设置', Dever::url('lib/set.home', 'agent')),
  215. //'list3' => array('名额权益', '"role_quota&search_option_role_id={id}&oper_table=role"'),
  216. )
  217. ),
  218. 'request' => array
  219. (
  220. 'getInfo' => array
  221. (
  222. # 匹配的正则或函数 选填项
  223. 'option' => array
  224. (
  225. 'type' => array('yes', 'in'),
  226. 'levelup' => 'yes',
  227. 'isbuy' => 'yes',
  228. 'area' => array('yes', 'in'),
  229. 'state' => 1,
  230. ),
  231. 'type' => 'all',
  232. 'col' => 'id,short_name as name,area,type,price',
  233. ),
  234. ),
  235. );