role.php 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  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' => 'float-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. ),
  151. 'state' => array
  152. (
  153. 'type' => 'tinyint-1',
  154. 'name' => '状态',
  155. 'default' => '1',
  156. 'desc' => '请选择状态',
  157. 'match' => 'is_numeric',
  158. ),
  159. 'cdate' => array
  160. (
  161. 'type' => 'int-11',
  162. 'name' => '创建时间',
  163. 'match' => array('is_numeric', time()),
  164. 'desc' => '',
  165. # 只有insert时才生效
  166. 'insert' => true,
  167. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  168. ),
  169. ),
  170. 'default' => array
  171. (
  172. 'col' => 'id,name,short_name,`desc`,type,area,isbuy,levelup,profit,price,state,cdate',
  173. 'value' => array
  174. (
  175. '1,"普通用户", "用户", "注册但未注册成功代理商角色的用户", 1, 1, 2, 2, "0", "0", 1,' . DEVER_TIME,
  176. '2,"城市代理商", "城市", "一个城市代理商,有一二三线城市的区分。获得区域内门店利润1%收益。", 2, 1, 1, 2, "1", "0", 1,' . DEVER_TIME,
  177. '3,"区县代理商", "区县", "一线城市的区,与二三线城市的县级代理商。获得区域内门店利润3%收益。", 2, 2, 1, 1, "3", "0", 1,' . DEVER_TIME,
  178. '4,"街道代理商", "街道", "一个街道区域的代理商。获得区域内门店利润5%收益。", 2, 3, 1, 1, "5", "0", 1,' . DEVER_TIME,
  179. '5,"创服代理商", "创服", "在开创本系统时的一个代理商角色,以后此角色不新增,要保留,因为其中还有一些权益未兑换。", 3, 1, 2, 1, "0", "0", 1,' . DEVER_TIME,
  180. '6,"创客会员", "创客", "有分销能力的会员,但不产生代理商收益。", 1, 1, 1, 2, "0", "5000", 1,' . DEVER_TIME,
  181. '7,"消客会员", "消客", "能带动产品销售量的会员。", 1, 1, 1, 2, "0", "2000", 1,' . DEVER_TIME,
  182. ),
  183. ),
  184. 'manage' => array
  185. (
  186. 'insert' => false,
  187. 'delete' => false,
  188. 'edit' => false,
  189. 'list_button' => array
  190. (
  191. 'fast' => array('编辑', '"role&where_id={id}&oper_save_jump=role&oper_table=role&oper_parent=role&area={area}"'),
  192. 'list1' => array('推荐奖励', '"role_reward&search_option_role_id={id}&oper_table=role"'),
  193. //'list2' => array('商品权益', '"role_goods&search_option_role_id={id}&oper_table=role"'),
  194. 'location1' => array('权益设置', Dever::url('lib/set.home', 'agent')),
  195. //'list3' => array('名额权益', '"role_quota&search_option_role_id={id}&oper_table=role"'),
  196. )
  197. ),
  198. 'request' => array
  199. (
  200. 'getInfo' => array
  201. (
  202. # 匹配的正则或函数 选填项
  203. 'option' => array
  204. (
  205. 'type' => array('yes', 'in'),
  206. 'levelup' => 'yes',
  207. 'isbuy' => 'yes',
  208. 'area' => array('yes', 'in'),
  209. 'state' => 1,
  210. ),
  211. 'type' => 'all',
  212. 'col' => 'id,short_name as name,area,type,price',
  213. ),
  214. ),
  215. );