member_level_log.php 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286
  1. <?php
  2. $mid = Dever::input('search_option_mid');
  3. $button = array();
  4. if ($mid) {
  5. $button = array
  6. (
  7. '返回上一页' => array('location', 'l=project/database/list&project=agent&table=member_area&page_type=1&mid=' . $mid),
  8. );
  9. }
  10. $level = function()
  11. {
  12. $array = array
  13. (
  14. -1 => array
  15. (
  16. 'id' => -1,
  17. 'name' => '普通',
  18. ),
  19. );
  20. $data = Dever::load('setting/level-state');
  21. if($data)
  22. {
  23. $array += $data;
  24. }
  25. return $array;
  26. };
  27. $type = array
  28. (
  29. 1 => '客户修改',
  30. 2 => '后台修改',
  31. );
  32. $admin = Dever::load('manage/auth.info');
  33. $admin_auth = false;
  34. if ($admin && $admin['role'] == 24){
  35. $admin_auth = $admin['role'];
  36. }
  37. return array
  38. (
  39. # 表名
  40. 'name' => 'member_level_log',
  41. # 显示给用户看的名称
  42. 'lang' => '等级变更记录',
  43. 'order' => 9,
  44. # 数据结构
  45. 'struct' => array
  46. (
  47. 'id' => array
  48. (
  49. 'type' => 'int-11',
  50. 'name' => 'ID',
  51. 'default' => '',
  52. 'desc' => '',
  53. 'match' => 'is_numeric',
  54. 'search' => 'order',
  55. 'update' => 'hidden',
  56. //'list' => true,
  57. ),
  58. 'mid' => array
  59. (
  60. 'type' => 'int-11',
  61. 'name' => '代理商姓名/手机号',
  62. 'default' => '-1',
  63. 'desc' => '代理商',
  64. 'match' => 'is_string',
  65. 'update' => 'text',
  66. 'search' => array
  67. (
  68. 'api' => 'agent/member-getSearch',
  69. 'col' => 'col',
  70. 'result' => 'id',
  71. 'search' => 'mid',
  72. ),
  73. 'list_name' => '代理商信息',
  74. 'list' => $admin_auth ? 'Dever::load("agent/lib/member.getOne", {mid}, "agent/member", true, true)' : 'Dever::load("agent/lib/member.getOne", {mid}, "agent/member", true)',
  75. 'list_order' => 1,
  76. ),
  77. 'order_id' => array
  78. (
  79. 'type' => 'int-11',
  80. 'name' => '关联订单',
  81. 'default' => '',
  82. 'desc' => '关联订单',
  83. 'match' => 'is_numeric',
  84. //'list' => 'Dever::db("agent/order-find#order_num", {order_id})',
  85. //'list' => true,
  86. //'list_order' => 6,
  87. ),
  88. 'agent-member-name'=> array
  89. (
  90. 'name' => '代理商',
  91. 'default' => '',
  92. 'desc' => '代理商',
  93. 'match' => 'option',
  94. # 读取另外表的关联方式
  95. 'sync' => array('mid', 'id'),
  96. //'list' => $mid ? false : true,
  97. //'list_order' => 3,
  98. ),
  99. 'agent-member-role'=> array
  100. (
  101. 'name' => '角色',
  102. 'default' => '',
  103. 'desc' => '角色',
  104. 'match' => 'option',
  105. # 读取另外表的关联方式
  106. 'sync' => array('mid', 'id'),
  107. //'list' => 'Dever::load("setting/role-find#name", "{agent-member-role}")',
  108. //'list_order' => 5,
  109. ),
  110. 'order_num' => array
  111. (
  112. 'type' => 'varchar-100',
  113. 'name' => '日志单号',
  114. 'default' => '',
  115. 'desc' => '日志单号',
  116. 'match' => 'is_string',
  117. 'update' => 'text',
  118. //'search' => 'fulltext',
  119. //'list' => true,
  120. //'list_order' => 2,
  121. ),
  122. 'old_level' => array
  123. (
  124. 'type' => 'int-11',
  125. 'name' => '变更前等级',
  126. 'default' => '-1',
  127. 'desc' => '原级别',
  128. 'match' => 'is_numeric',
  129. 'update' => 'radio',
  130. 'option' => $level,
  131. 'search' => 'select',
  132. 'list' => true,
  133. 'list_order' => 3,
  134. ),
  135. 'new_level' => array
  136. (
  137. 'type' => 'int-11',
  138. 'name' => '变更后等级',
  139. 'default' => '-1',
  140. 'desc' => '新级别',
  141. 'match' => 'is_numeric',
  142. 'update' => 'radio',
  143. 'option' => $level,
  144. 'search' => 'select',
  145. 'list' => true,
  146. 'list_order' => 4,
  147. ),
  148. 'new_sell' => array
  149. (
  150. 'type' => 'decimal-11,2',
  151. 'name' => '新增业绩',
  152. 'default' => '0',
  153. 'desc' => '新增业绩',
  154. 'match' => 'is_numeric',
  155. 'update' => 'text',
  156. //'list' => true,
  157. //'list_order' => 5,
  158. ),
  159. 'sell' => array
  160. (
  161. 'type' => 'decimal-11,2',
  162. 'name' => '升级时业绩',
  163. 'default' => '0',
  164. 'desc' => '总业绩',
  165. 'match' => 'is_numeric',
  166. 'update' => 'text',
  167. 'list' => true,
  168. 'list_order' => 5,
  169. ),
  170. 'group_num' => array
  171. (
  172. 'type' => 'int-11',
  173. 'name' => '代理商团队数',
  174. 'default' => '0',
  175. 'desc' => '代理商团队数',
  176. 'match' => 'is_numeric',
  177. 'update' => 'text',
  178. 'list' => true,
  179. 'list_order' => 9,
  180. ),
  181. 'type' => array
  182. (
  183. 'type' => 'tinyint-1',
  184. 'name' => '类型',
  185. 'default' => '1',
  186. 'desc' => '类型',
  187. 'match' => 'is_numeric',
  188. 'update' => 'radio',
  189. 'option' => $type,
  190. ),
  191. 'audit_date' => array
  192. (
  193. 'type' => 'int-11',
  194. 'name' => '审核时间',
  195. 'match' => 'is_numeric',
  196. 'desc' => '审核时间',
  197. 'default' => '',
  198. ),
  199. 'audit_admin' => array
  200. (
  201. 'type' => 'int-11',
  202. 'name' => '操作人',
  203. 'default' => '',
  204. 'match' => 'is_numeric',
  205. 'desc' => '操作人',
  206. 'list' => '"{audit_admin}" > 0 ? Dever::load("manage/admin-find#username", {audit_admin}) : "-"',
  207. // 'list_order' => 8,
  208. ),
  209. 'state' => array
  210. (
  211. 'type' => 'tinyint-1',
  212. 'name' => '状态',
  213. 'default' => '1',
  214. 'desc' => '请选择状态',
  215. 'match' => 'is_numeric',
  216. ),
  217. 'cdate' => array
  218. (
  219. 'type' => 'int-11',
  220. 'name' => '更改时间',
  221. 'match' => array('is_numeric', time()),
  222. 'desc' => '',
  223. # 只有insert时才生效
  224. 'insert' => true,
  225. 'search' => 'date',
  226. 'list' => 'date("Y-m-d H:i", {cdate})',
  227. 'list_order' => 2,
  228. ),
  229. ),
  230. 'alter' => array
  231. (
  232. 5 => array
  233. (
  234. array('update', 'new_sell', 'new_sell', 'decimal-11,2 0 新增业绩'),
  235. array('update', 'sell', 'sell', 'decimal-11,2 0 升级时业绩'),
  236. ),
  237. 'version' => 5,
  238. ),
  239. 'manage' => array
  240. (
  241. 'edit' => false,
  242. 'insert' => false,
  243. 'delete' => false,
  244. 'button' => $button,
  245. ),
  246. 'request' => array
  247. (
  248. 'getData' => array
  249. (
  250. # 匹配的正则或函数 选填项
  251. 'option' => array
  252. (
  253. 'mid' => 'yes',
  254. 'type' => 'yes',
  255. 'state' => 1,
  256. ),
  257. 'order' => array('type' => 'asc', 'id' => 'desc'),
  258. 'type' => 'all',
  259. 'col' => '*, total_num-sell_num as num',
  260. ),
  261. ),
  262. );