member_area.php 4.4 KB

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