role.php 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311
  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. 'value' => '1',
  98. //'show' => 'type=2',
  99. ),
  100. 'price' => array
  101. (
  102. 'type' => 'decimal-11,2',
  103. 'name' => '代理价格-以元为单位',
  104. 'default' => '0',
  105. 'desc' => '代理价格',
  106. 'match' => 'option',
  107. 'update' => 'text',
  108. //'list' => true,
  109. 'show' => 'type=1',
  110. ),
  111. 'soft' => array
  112. (
  113. 'type' => 'varchar-50',
  114. 'name' => '软件服务费-如果填写软件服务费,则代理商订单可以进行拆分,如带有%号,就表示是百分比,如10%',
  115. 'default' => '0',
  116. 'desc' => '软件服务费',
  117. 'match' => 'option',
  118. 'update' => 'text',
  119. ),
  120. 'option_price' => array
  121. (
  122. 'type' => 'varchar-50',
  123. 'name' => '赠送期权价值-如果填写赠送期权价值,如带有%号,就表示是百分比,如10%',
  124. 'default' => '0',
  125. 'desc' => '软件服务费',
  126. 'match' => 'option',
  127. 'update' => 'text',
  128. ),
  129. 'profit' => array
  130. (
  131. 'type' => 'int-11',
  132. 'name' => '收益-区域内门店利润百分比,这里直接输入数字即可,如输入10,就是10%',
  133. 'default' => '0',
  134. 'desc' => '收益',
  135. 'match' => 'is_numeric',
  136. 'update' => 'text',
  137. 'show' => 'type=2',
  138. ),
  139. 'isbuy' => array
  140. (
  141. 'type' => 'tinyint-1',
  142. 'name' => '是否可购买-是否允许购买',
  143. 'default' => '1',
  144. 'desc' => '是否可购买',
  145. 'match' => 'is_numeric',
  146. 'update' => 'radio',
  147. 'option' => $yes,
  148. 'list' => true,
  149. ),
  150. 'levelup' => array
  151. (
  152. 'type' => 'tinyint-1',
  153. 'name' => '是否可升级-该角色是否可以升级到新角色',
  154. 'default' => '1',
  155. 'desc' => '是否可升级',
  156. 'match' => 'is_numeric',
  157. 'update' => 'radio',
  158. 'option' => $yes,
  159. 'list' => true,
  160. 'control' => 'levelup',
  161. ),
  162. 'levelup_yue' => array
  163. (
  164. 'type' => 'tinyint-1',
  165. 'name' => '升级补余额-升级到新角色,是否补足余额,如果选否,就直接用新角色全额购买',
  166. 'default' => '1',
  167. 'desc' => '升级补余额',
  168. 'match' => 'is_numeric',
  169. 'update' => 'radio',
  170. 'option' => $yes,
  171. 'show' => 'levelup=1',
  172. ),
  173. 'max_me_num' => array
  174. (
  175. 'type' => 'int-11',
  176. 'name' => '赠送名额最大值',
  177. 'default' => '100',
  178. 'desc' => '赠送名额最大值',
  179. 'match' => 'is_numeric',
  180. 'update' => 'text',
  181. //'list' => true,
  182. ),
  183. 'reorder' => array
  184. (
  185. 'type' => 'int-11',
  186. 'name' => '排序-数值越大越靠前',
  187. 'default' => '1',
  188. 'desc' => '请输入排序',
  189. 'match' => 'option',
  190. 'update' => 'text',
  191. 'search' => 'order',
  192. 'list' => true,
  193. 'order' => 'desc',
  194. 'edit' => true,
  195. ),
  196. 'state' => array
  197. (
  198. 'type' => 'tinyint-1',
  199. 'name' => '状态',
  200. 'default' => '1',
  201. 'desc' => '请选择状态',
  202. 'match' => 'is_numeric',
  203. ),
  204. 'cdate' => array
  205. (
  206. 'type' => 'int-11',
  207. 'name' => '创建时间',
  208. 'match' => array('is_numeric', time()),
  209. 'desc' => '',
  210. # 只有insert时才生效
  211. 'insert' => true,
  212. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  213. ),
  214. ),
  215. 'alter' => array
  216. (
  217. 5 => array
  218. (
  219. array('update', 'price', 'price', 'decimal-11,2 0 代理价格'),
  220. ),
  221. 'version' => 5,
  222. ),
  223. 'default' => array
  224. (
  225. 'col' => 'id,name,short_name,`desc`,type,area,isbuy,levelup,levelup_yue,profit,price,state,cdate',
  226. 'value' => array
  227. (
  228. '1,"普通用户", "用户", "注册但未注册成功代理商角色的用户", 1, 1, 2, 2, 2, "0", "0", 1,' . DEVER_TIME,
  229. '2,"城市代理商", "城市", "一个城市代理商,有一二三线城市的区分。获得区域内门店利润1%收益。", 2, 1, 1, 2, 1, "1", "0", 1,' . DEVER_TIME,
  230. '3,"区县代理商", "区县", "一线城市的区,与二三线城市的县级代理商。获得区域内门店利润3%收益。", 2, 2, 1, 1, 1, "3", "0", 1,' . DEVER_TIME,
  231. '4,"街道代理商", "街道", "一个街道区域的代理商。获得区域内门店利润5%收益。", 2, 3, 1, 1, 1, "5", "0", 1,' . DEVER_TIME,
  232. '5,"创服代理商", "创服", "在开创本系统时的一个代理商角色,以后此角色不新增,要保留,因为其中还有一些权益未兑换。", 3, 1, 2, 1, 1, "0", "0", 1,' . DEVER_TIME,
  233. '6,"创客会员", "创客", "有分销能力的会员,但不产生代理商收益。", 1, 1, 1, 2, 2, "0", "5000", 1,' . DEVER_TIME,
  234. '7,"消客会员", "消客", "能带动产品销售量的会员。", 1, 1, 1, 2, 2, "0", "2000", 1,' . DEVER_TIME,
  235. ),
  236. ),
  237. 'manage' => array
  238. (
  239. //'insert' => false,
  240. 'delete' => false,
  241. 'edit' => false,
  242. 'list_button' => array
  243. (
  244. 'fast' => array('编辑', '"role&where_id={id}&oper_save_jump=role&oper_table=role&oper_parent=role&area={area}"'),
  245. 'list1' => array('直推奖励', '"role_reward&search_option_role_id={id}&oper_table=role"'),
  246. //'list2' => array('商品权益', '"role_goods&search_option_role_id={id}&oper_table=role"'),
  247. 'location1' => array('赠送权益', Dever::url('lib/set.home', 'agent')),
  248. 'list2' => array('自动升级', '"role_up&search_option_role_id={id}&oper_table=role"'),
  249. //'list3' => array('名额权益', '"role_quota&search_option_role_id={id}&oper_table=role"'),
  250. )
  251. ),
  252. 'request' => array
  253. (
  254. 'getInfo' => array
  255. (
  256. # 匹配的正则或函数 选填项
  257. 'option' => array
  258. (
  259. 'type' => array('yes', 'in'),
  260. 'levelup' => 'yes',
  261. 'isbuy' => 'yes',
  262. 'area' => array('yes', 'in'),
  263. 'state' => 1,
  264. ),
  265. 'type' => 'all',
  266. 'order' => array('reorder' => 'desc', 'id' => 'desc'),
  267. 'col' => 'id,short_name as name,area,type,price',
  268. ),
  269. 'getAll' => array
  270. (
  271. # 匹配的正则或函数 选填项
  272. 'option' => array
  273. (
  274. 'id' => array('yes','>'),
  275. 'state' => 1,
  276. ),
  277. 'type' => 'all',
  278. 'order' => array('reorder' => 'desc', 'id' => 'asc'),
  279. 'col' => '*',
  280. ),
  281. ),
  282. );