member_goods_log.php 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275
  1. <?php
  2. $type = Dever::db('agent/member_goods')->config['set']['type'];
  3. $mid = Dever::input('search_option_mid');
  4. $search_api_mid = Dever::input('search_api_mid');
  5. $button = array();
  6. if ($mid) {
  7. $button = array
  8. (
  9. '返回上一页' => array('location', 'l=project/database/list&project=agent&table=member_goods&search_option_mid=' . $mid . '&search_api_mid=' . $search_api_mid),
  10. );
  11. }
  12. $admin = Dever::load('manage/auth.info');
  13. $admin_auth = false;
  14. if ($admin && $admin['role'] == 24){
  15. $admin_auth = $admin['role'];
  16. }
  17. return array
  18. (
  19. # 表名
  20. 'name' => 'member_goods_log',
  21. # 显示给用户看的名称
  22. 'lang' => '代理商权益日志',
  23. 'menu' => false,
  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. 'update' => 'hidden',
  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. 'search' => array
  47. (
  48. 'api' => 'agent/member-getSearch',
  49. 'col' => 'col',
  50. 'result' => 'id',
  51. 'search' => 'mid',
  52. ),
  53. 'list_name' => '代理商信息',
  54. 'list' => $admin_auth ? 'Dever::load("agent/lib/member.getOne", {mid}, "agent/member", true,true)' : 'Dever::load("agent/lib/member.getOne", {mid}, "agent/member", true)',
  55. 'list_order' => 1,
  56. ),
  57. 'parent_order_num' => array
  58. (
  59. 'type' => 'varchar-100',
  60. 'name' => '关联订单',
  61. 'default' => '',
  62. 'desc' => '关联订单',
  63. 'match' => 'is_string',
  64. 'list' => true,
  65. 'list_order' => 11,
  66. ),
  67. 'agent-member-name'=> array
  68. (
  69. 'name' => '代理商',
  70. 'default' => '',
  71. 'desc' => '代理商',
  72. 'match' => 'option',
  73. # 读取另外表的关联方式
  74. 'sync' => array('mid', 'id'),
  75. 'list' => $mid ? false : true,
  76. 'list_order' => 3,
  77. ),
  78. 'agent-member-role'=> array
  79. (
  80. 'name' => '角色',
  81. 'default' => '',
  82. 'desc' => '角色',
  83. 'match' => 'option',
  84. # 读取另外表的关联方式
  85. 'sync' => array('mid', 'id'),
  86. //'list' => 'Dever::load("setting/role-find#name", "{agent-member-role}")',
  87. 'list_order' => 5,
  88. ),
  89. 'order_num' => array
  90. (
  91. 'type' => 'varchar-100',
  92. 'name' => '日志单号',
  93. 'default' => '',
  94. 'desc' => '日志单号',
  95. 'match' => 'is_string',
  96. 'update' => 'text',
  97. 'search' => 'fulltext',
  98. 'list' => true,
  99. 'list_order' => 1,
  100. ),
  101. 'type' => array
  102. (
  103. 'type' => 'tinyint-1',
  104. 'name' => '权益类型',
  105. 'default' => '1',
  106. 'desc' => '类型',
  107. 'match' => 'is_numeric',
  108. 'update' => 'radio',
  109. 'option' => $type,
  110. 'search' => 'select',
  111. 'list' => true,
  112. 'list_order' => 6,
  113. ),
  114. 'type_id' => array
  115. (
  116. 'type' => 'int-11',
  117. 'name' => '类型id',
  118. 'default' => '-1',
  119. 'desc' => '类型id',
  120. 'match' => 'is_numeric',
  121. 'list_name' => '权益名称',
  122. //'list' => 'Dever::load("agent/lib/manage.getGoods#name", "{type}", "{type_id}", "{sku_id}")',
  123. 'list_order' => 7,
  124. ),
  125. 'sku_id' => array
  126. (
  127. 'type' => 'int-11',
  128. 'name' => 'sku_id',
  129. 'default' => '-1',
  130. 'desc' => 'sku_id',
  131. 'match' => 'is_numeric',
  132. ),
  133. 'name' => array
  134. (
  135. 'type' => 'varchar-100',
  136. 'name' => '权益名称',
  137. 'default' => '',
  138. 'desc' => '权益名称',
  139. 'match' => 'is_string',
  140. 'update' => 'text',
  141. //'search' => 'fulltext',
  142. 'list' => '"{name}" ? "{name}" : Dever::load("agent/lib/manage.getGoods#name", "{type}", "{type_id}", "{sku_id}")',
  143. 'list_order' => 7,
  144. ),
  145. 'num' => array
  146. (
  147. 'type' => 'varchar-11',
  148. 'name' => '数量',
  149. 'default' => '0',
  150. 'desc' => '数量',
  151. 'match' => 'is_string',
  152. 'list' => true,
  153. 'list_order' => 8,
  154. ),
  155. 'pnum' => array
  156. (
  157. 'type' => 'varchar-11',
  158. 'name' => '操作前数量',
  159. 'default' => '0',
  160. 'desc' => '操作前数量',
  161. 'match' => 'option',
  162. 'list_name' => '操作前/后',
  163. 'list' => '"{pnum}/{fnum}"',
  164. 'list_order' => 9,
  165. ),
  166. 'fnum' => array
  167. (
  168. 'type' => 'varchar-11',
  169. 'name' => '操作后数量',
  170. 'default' => '0',
  171. 'desc' => '操作后数量',
  172. 'match' => 'option',
  173. ),
  174. 'desc' => array
  175. (
  176. 'type' => 'varchar-600',
  177. 'name' => '备注',
  178. 'default' => '',
  179. 'desc' => '备注',
  180. 'match' => 'is_string',
  181. 'update' => 'text',
  182. 'list' => true,
  183. 'list_order' => 10,
  184. ),
  185. 'admin' => array
  186. (
  187. 'type' => 'int-11',
  188. 'name' => '操作人',
  189. 'default' => '',
  190. 'match' => 'is_numeric',
  191. 'desc' => '操作人',
  192. 'list' => '"{admin}" > 0 ? Dever::load("manage/admin-find#username", {admin}) : "-"',
  193. 'list_order' => 8,
  194. ),
  195. 'state' => array
  196. (
  197. 'type' => 'tinyint-1',
  198. 'name' => '状态',
  199. 'default' => '1',
  200. 'desc' => '请选择状态',
  201. 'match' => 'is_numeric',
  202. ),
  203. 'cdate' => array
  204. (
  205. 'type' => 'int-11',
  206. 'name' => '操作时间',
  207. 'match' => array('is_numeric', time()),
  208. 'desc' => '',
  209. # 只有insert时才生效
  210. 'insert' => true,
  211. 'search' => 'date',
  212. 'list' => 'date("Y-m-d H:i", {cdate})',
  213. 'list_order' => 2,
  214. ),
  215. ),
  216. 'manage' => array
  217. (
  218. 'edit' => false,
  219. 'insert' => false,
  220. 'delete' => false,
  221. 'button' => $button,
  222. ),
  223. 'request' => array
  224. (
  225. 'getData' => array
  226. (
  227. # 匹配的正则或函数 选填项
  228. 'option' => array
  229. (
  230. 'mid' => 'yes',
  231. 'type' => 'yes',
  232. 'state' => 1,
  233. ),
  234. 'order' => array('type' => 'asc', 'id' => 'desc'),
  235. 'type' => 'all',
  236. 'col' => '*, total_num-sell_num as num',
  237. ),
  238. 'getOne' => array
  239. (
  240. # 匹配的正则或函数 选填项
  241. 'option' => array
  242. (
  243. 'type_id' => 'yes',
  244. 'type' => 'yes',
  245. 'sku_id' => 'yes',
  246. 'state' => 1,
  247. ),
  248. 'order' => array('id' => 'desc'),
  249. 'type' => 'one',
  250. 'col' => '*',
  251. ),
  252. ),
  253. );