member_area.php 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  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. 'search' => array
  48. (
  49. 'api' => 'agent/member-getSearch',
  50. 'col' => 'col',
  51. 'result' => 'id',
  52. 'search' => 'mid',
  53. ),
  54. 'list_name' => '代理商信息',
  55. 'list' => 'Dever::load("agent/lib/member.getOne", {mid}, "agent/member", true)',
  56. ),
  57. 'order_id' => array
  58. (
  59. 'type' => 'int-11',
  60. 'name' => '订单表id',
  61. 'default' => '',
  62. 'desc' => '订单表id',
  63. 'match' => 'is_numeric',
  64. ),
  65. 'type' => array
  66. (
  67. 'type' => 'tinyint-1',
  68. 'name' => '类型',
  69. 'default' => '1',
  70. 'desc' => '类型',
  71. 'match' => 'is_numeric',
  72. 'update' => 'radio',
  73. 'option' => $type,
  74. ),
  75. 'price' => array
  76. (
  77. 'type' => 'decimal-11,2',
  78. 'name' => '实付金额',
  79. 'default' => '0',
  80. 'desc' => '金额',
  81. 'match' => 'option',
  82. 'update' => 'text',
  83. 'list' => true,
  84. ),
  85. 'role' => array
  86. (
  87. 'type' => 'int-11',
  88. 'name' => '代理角色',
  89. 'default' => '',
  90. 'desc' => '代理角色',
  91. 'match' => 'is_numeric',
  92. 'search' => 'select',
  93. 'update' => 'checkbox',
  94. 'option' => $role,
  95. // 'list' => true,
  96. ),
  97. 'area' => array
  98. (
  99. 'type' => 'varchar-500',
  100. 'name' => '区域',
  101. 'default' => '',
  102. 'desc' => '区域',
  103. 'match' => 'option',
  104. 'search' => 'linkage',
  105. 'update' => 'linkage',
  106. 'option' => Dever::url('api.get?level_total=4', 'area'),
  107. 'list' => 'Dever::load("area/api.string", "{area}")',
  108. ),
  109. 'state' => array
  110. (
  111. 'type' => 'tinyint-1',
  112. 'name' => '状态',
  113. 'default' => '1',
  114. 'desc' => '请选择状态',
  115. 'match' => 'is_numeric',
  116. ),
  117. 'cdate' => array
  118. (
  119. 'type' => 'int-11',
  120. 'name' => '申请时间',
  121. 'match' => array('is_numeric', time()),
  122. 'desc' => '',
  123. # 只有insert时才生效
  124. //'insert' => true,
  125. 'search' => 'date',
  126. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  127. ),
  128. ),
  129. 'alter' => array
  130. (
  131. 5 => array
  132. (
  133. array('update', 'price', 'price', 'decimal-11,2 0 实付金额'),
  134. ),
  135. 'version' => 5,
  136. ),
  137. 'manage' => array
  138. (
  139. 'insert' => false,
  140. 'delete' => false,
  141. 'edit' => false,
  142. 'page_list' => 'member_area',
  143. ),
  144. 'request' => array
  145. (
  146. 'getData' => array
  147. (
  148. # 匹配的正则或函数 选填项
  149. 'option' => array
  150. (
  151. 'mid' => 'yes',
  152. 'state' => 1,
  153. ),
  154. 'type' => 'all',
  155. 'order' => array('id' => 'desc'),
  156. 'col' => '*',
  157. ),
  158. 'getOne' => array
  159. (
  160. # 匹配的正则或函数 选填项
  161. 'option' => array
  162. (
  163. 'order_id' => 'yes',
  164. 'role' => 'yes',
  165. 'mid' => 'yes',
  166. 'type' => 'yes',
  167. 'area' => 'yes',
  168. 'state' => 1,
  169. ),
  170. 'type' => 'one',
  171. 'order' => array('id' => 'desc'),
  172. 'col' => '*',
  173. ),
  174. ),
  175. );