member_area.php 4.4 KB

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