member_area.php 5.4 KB

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