member_area.php 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  1. <?php
  2. $role = function()
  3. {
  4. $array = array();
  5. $data = Dever::load('setting/role-state');
  6. if($data)
  7. {
  8. $array += $data;
  9. }
  10. return $array;
  11. };
  12. $excel = false;
  13. if (Dever::load('manage/auth')->checkFunc('menu_240.menu_271', 'area_excel1', '已售区域列表导出')) {
  14. $excel = array
  15. (
  16. array('已售区域列表导出', '已售区域列表导出', 'agent/lib/manage.out_arealog'),
  17. );
  18. }
  19. $type = array
  20. (
  21. 1 => '购买',
  22. 2 => '赠送',
  23. 3 => '后台修改',
  24. 4 => '系统导入',
  25. 5 => '系统同步',
  26. );
  27. return array
  28. (
  29. # 表名
  30. 'name' => 'member_area',
  31. # 显示给用户看的名称
  32. 'lang' => '已售区域列表',
  33. 'order' => 8,
  34. # 数据结构
  35. 'struct' => array
  36. (
  37. 'id' => array
  38. (
  39. 'type' => 'int-11',
  40. 'name' => 'ID',
  41. 'default' => '',
  42. 'desc' => '',
  43. 'match' => 'is_numeric',
  44. 'search' => 'order',
  45. //'list' => true,
  46. ),
  47. 'mid' => array
  48. (
  49. 'type' => 'int-11',
  50. 'name' => '代理商姓名/手机号',
  51. 'default' => '-1',
  52. 'desc' => '代理商',
  53. 'match' => 'is_string',
  54. 'update' => 'text',
  55. 'search' => array
  56. (
  57. 'api' => 'agent/member-getSearch',
  58. 'col' => 'col',
  59. 'result' => 'id',
  60. 'search' => 'mid',
  61. ),
  62. 'list_name' => '代理商信息',
  63. 'list' => 'Dever::load("agent/lib/member.getOne", {mid}, "agent/member", true)',
  64. ),
  65. 'order_id' => array
  66. (
  67. 'type' => 'int-11',
  68. 'name' => '订单表id',
  69. 'default' => '',
  70. 'desc' => '订单表id',
  71. 'match' => 'is_numeric',
  72. ),
  73. 'type' => array
  74. (
  75. 'type' => 'tinyint-1',
  76. 'name' => '类型',
  77. 'default' => '1',
  78. 'desc' => '类型',
  79. 'match' => 'is_numeric',
  80. 'update' => 'radio',
  81. 'option' => $type,
  82. ),
  83. 'price' => array
  84. (
  85. 'type' => 'decimal-11,2',
  86. 'name' => '实付金额',
  87. 'default' => '0',
  88. 'desc' => '金额',
  89. 'match' => 'option',
  90. 'update' => 'text',
  91. 'list' => true,
  92. ),
  93. 'role' => array
  94. (
  95. 'type' => 'int-11',
  96. 'name' => '代理角色',
  97. 'default' => '',
  98. 'desc' => '代理角色',
  99. 'match' => 'is_numeric',
  100. 'search' => 'select',
  101. 'update' => 'checkbox',
  102. 'option' => $role,
  103. // 'list' => true,
  104. ),
  105. 'area' => array
  106. (
  107. 'type' => 'varchar-500',
  108. 'name' => '区域',
  109. 'default' => '',
  110. 'desc' => '区域',
  111. 'match' => 'option',
  112. 'search' => 'linkage',
  113. 'update' => 'linkage',
  114. 'option' => Dever::url('api.get?level_total=4', 'area'),
  115. 'list' => 'Dever::load("area/api.string", "{area}")',
  116. ),
  117. 'state' => array
  118. (
  119. 'type' => 'tinyint-1',
  120. 'name' => '状态',
  121. 'default' => '1',
  122. 'desc' => '请选择状态',
  123. 'match' => 'is_numeric',
  124. ),
  125. 'cdate' => array
  126. (
  127. 'type' => 'int-11',
  128. 'name' => '申请时间',
  129. 'match' => array('is_numeric', time()),
  130. 'desc' => '',
  131. # 只有insert时才生效
  132. //'insert' => true,
  133. 'search' => 'date',
  134. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  135. ),
  136. ),
  137. 'alter' => array
  138. (
  139. 5 => array
  140. (
  141. array('update', 'price', 'price', 'decimal-11,2 0 实付金额'),
  142. ),
  143. 'version' => 5,
  144. ),
  145. 'manage' => array
  146. (
  147. 'insert' => false,
  148. 'delete' => false,
  149. 'edit' => false,
  150. 'page_list' => 'member_area',
  151. 'excel' => $excel,
  152. ),
  153. 'request' => array
  154. (
  155. 'getData' => array
  156. (
  157. # 匹配的正则或函数 选填项
  158. 'option' => array
  159. (
  160. 'mid' => 'yes',
  161. 'state' => 1,
  162. ),
  163. 'type' => 'all',
  164. 'order' => array('id' => 'desc'),
  165. 'col' => '*',
  166. ),
  167. 'getOne' => array
  168. (
  169. # 匹配的正则或函数 选填项
  170. 'option' => array
  171. (
  172. 'order_id' => 'yes',
  173. 'role' => 'yes',
  174. 'mid' => 'yes',
  175. 'type' => 'yes',
  176. 'area' => 'yes',
  177. 'state' => 1,
  178. ),
  179. 'type' => 'one',
  180. 'order' => array('id' => 'desc'),
  181. 'col' => '*',
  182. ),
  183. ),
  184. );