member_area.php 4.4 KB

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