member_shop_log.php 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286
  1. <?php
  2. $shop = function()
  3. {
  4. $array = array();
  5. $data = Dever::db('shop/info-state');
  6. if($data)
  7. {
  8. $array += $data;
  9. }
  10. return $array;
  11. };
  12. $role = function()
  13. {
  14. $array = array();
  15. $data = Dever::load('setting/lib/manage.role');
  16. if($data)
  17. {
  18. $array += $data;
  19. }
  20. return $array;
  21. };
  22. $new_shop = Dever::input('search_option_new_shop_id');
  23. $group = 't_1.mid,t_1.new_shop_id';
  24. $admin = Dever::load('manage/auth.info');
  25. $admin_auth = false;
  26. if ($admin && $admin['role'] == 24){
  27. $admin_auth = $admin['role'];
  28. }
  29. # 权限设置 1是归店记录列表、2是归店详细信息
  30. $search_auth = Dever::input('search_option_dever_auth', 1);
  31. $excel = array();
  32. if(Dever::load('manage/auth')->checkFunc('agent.member_shop_log', 'editshoplog', '归店记录明细')){
  33. $excel[] = array('归店记录明细', '归店记录明细', 'agent/lib/member.out_member_shop_log');
  34. }
  35. $status = array
  36. (
  37. 1 => '主信息',
  38. 2 => '历史信息',
  39. );
  40. return array
  41. (
  42. # 表名
  43. 'name' => 'member_shop_log',
  44. # 显示给用户看的名称
  45. 'lang' => '归店记录列表',
  46. 'order' => 9,
  47. # 数据结构
  48. 'struct' => array
  49. (
  50. 'id' => array
  51. (
  52. 'type' => 'int-11',
  53. 'name' => 'ID',
  54. 'default' => '',
  55. 'desc' => '',
  56. 'match' => 'is_numeric',
  57. 'search' => 'order',
  58. 'update' => 'hidden',
  59. //'list' => true,
  60. ),
  61. 'mid' => array
  62. (
  63. 'type' => 'int-11',
  64. 'name' => '代理商姓名/手机号',
  65. 'default' => '-1',
  66. 'desc' => '代理商',
  67. 'match' => 'is_string',
  68. 'update' => 'text',
  69. 'search' => array
  70. (
  71. 'api' => 'agent/member-getSearch',
  72. 'col' => 'col',
  73. 'result' => 'id',
  74. 'search' => 'mid',
  75. ),
  76. 'list_name' => '代理商信息',
  77. 'list' => $admin_auth ? 'Dever::load("agent/lib/member.getOne", {mid}, "agent/member", true,true)' : ($search_auth == 1 ? 'Dever::load("agent/lib/member.getOne", {mid}, "agent/member", true)': 'Dever::load("bill/lib/manage.guidian",{mid})'),
  78. 'list_order' => 1,
  79. ),
  80. 'agent-member-role'=> array
  81. (
  82. 'name' => '代理角色',
  83. 'default' => '',
  84. 'desc' => '代理角色',
  85. 'match' => 'option',
  86. # 读取另外表的关联方式
  87. 'sync' => array('mid', 'id'),
  88. 'search' => 'select',
  89. 'option' => $role,
  90. 'search_col' => 'agent-member-role',
  91. //'list' => 'Dever::load("setting/role-find#name", "{agent-member-role}")',
  92. //'list_order' => 3,
  93. ),
  94. 'old_shop_id' => array
  95. (
  96. 'type' => 'int-11',
  97. 'name' => '变更前店铺名称',
  98. 'default' => '',
  99. 'desc' => '店铺名称',
  100. 'match' => 'is_numeric',
  101. 'option' => $shop,
  102. 'list_name' => $search_auth == 2 ? '角色' : '变更前店铺名称',
  103. 'list' => $search_auth == 1 ? true : 'Dever::load("bill/lib/manage.role",{mid})',
  104. //'list_order' => 6,
  105. ),
  106. 'new_shop_id' => array
  107. (
  108. 'type' => 'int-11',
  109. 'name' => '变更后店铺名称',
  110. 'default' => '',
  111. 'desc' => '店铺名称',
  112. 'match' => 'is_numeric',
  113. 'search' => 'hidden',
  114. 'option' => $shop,
  115. 'list' => $search_auth == 1 ? true : false,
  116. ),
  117. 'dever_auth' => array
  118. (
  119. 'name' => '类型',
  120. 'default' => '',
  121. 'desc' => '类型',
  122. 'match' => 'is_string',
  123. 'search' => 'hidden',
  124. ),
  125. 'dever_time' => array
  126. (
  127. 'name' => '归店时间',
  128. 'default' => '',
  129. 'desc' => '类型',
  130. 'match' => 'is_string',
  131. // 'search' => 'hidden',
  132. //'search' => $search_auth == 2 ? 'date' : false,
  133. ),
  134. 'status' => array
  135. (
  136. 'type' => 'tinyint-1',
  137. 'name' => '状态',
  138. 'default' => '2',
  139. 'desc' => '请选择状态',
  140. 'match' => 'is_numeric',
  141. ),
  142. 'state' => array
  143. (
  144. 'type' => 'tinyint-1',
  145. 'name' => '状态',
  146. 'default' => '1',
  147. 'desc' => '请选择状态',
  148. 'match' => 'is_numeric',
  149. ),
  150. 'cdate' => array
  151. (
  152. 'type' => 'int-11',
  153. 'name' => '归店时间',
  154. 'match' => array('is_numeric', time()),
  155. 'desc' => '',
  156. # 只有insert时才生效
  157. 'insert' => true,
  158. 'search' => $search_auth == 1 ? 'month' : 'date',
  159. 'list' => 'date("Y-m-d H:i", {cdate})',
  160. //'order' => 'desc',
  161. ),
  162. ),
  163. 'manage' => array
  164. (
  165. 'edit' => false,
  166. 'insert' => false,
  167. 'delete' => false,
  168. 'excel' => $excel,
  169. ),
  170. 'request' => array
  171. (
  172. 'list' => array
  173. (
  174. # 匹配的正则或函数 选填项
  175. 'option' => array
  176. (
  177. 'mid' => array('yes-t_1.mid', 'in'),
  178. 'start_cdate' => array('yes-t_1.cdate','>='),
  179. 'end_cdate' => array('yes-t_1.cdate','<='),
  180. 'new_shop_id' => 'yes-t_1.new_shop_id',
  181. 'agent-member-role' => 'yes-t_2.role',
  182. 'status' => 'yes-t_1.status',
  183. 'state' => 'yes-t_1.state-1',
  184. ),
  185. 'join' => array
  186. (
  187. array
  188. (
  189. 'table' => 'agent/member',
  190. 'type' => 'left join',
  191. 'on' => array('mid','id'),
  192. 'col' => 't_2.id as mid',
  193. ),
  194. ),
  195. 'type' => 'all',
  196. 'group' => $group,
  197. 'order' => array('t_1.id' => 'desc'),
  198. 'page' => array(20, 'list'),
  199. 'col' => '*',
  200. ),
  201. 'getAll' => array
  202. (
  203. # 匹配的正则或函数 选填项
  204. 'option' => array
  205. (
  206. 'start' => array('yes-cdate','>='),
  207. 'end' => array('yes-cdate','<='),
  208. 'new_shop_id' => 'yes',
  209. 'state' => 1,
  210. ),
  211. 'type' => 'count',
  212. // 'order' => array('cdate' => 'desc'),
  213. 'col' => '*',
  214. ),
  215. 'getAllByShop' => array
  216. (
  217. # 匹配的正则或函数 选填项
  218. 'option' => array
  219. (
  220. 'start' => array('yes-cdate','>='),
  221. 'end' => array('yes-cdate','<='),
  222. 'new_shop_id' => 'yes',
  223. 'status' => 1,
  224. 'state' => 1,
  225. ),
  226. 'type' => 'all',
  227. // 'order' => array('cdate' => 'desc'),
  228. 'col' => '*|mid',
  229. ),
  230. 'getGui' => array
  231. (
  232. # 匹配的正则或函数 选填项
  233. 'option' => array
  234. (
  235. 'start' => array('yes-cdate','>='),
  236. 'end' => array('yes-cdate','<='),
  237. // 'new_shop_id' => 'yes',
  238. 'state' => 1,
  239. ),
  240. 'type' => 'all',
  241. 'order' => array('cdate' => 'asc'),
  242. 'col' => '*',
  243. ),
  244. 'getLog' => array
  245. (
  246. # 匹配的正则或函数 选填项
  247. 'option' => array
  248. (
  249. 'start' => array('yes-cdate','>='),
  250. 'end' => array('yes-cdate','<='),
  251. 'new_shop_id' => 'yes',
  252. 'state' => 1,
  253. ),
  254. 'type' => 'all',
  255. 'order' => array('cdate' => 'asc'),
  256. 'col' => '*',
  257. ),
  258. 'getData' => array
  259. (
  260. # 匹配的正则或函数 选填项
  261. 'option' => array
  262. (
  263. 'state' => 1,
  264. ),
  265. 'type' => 'all',
  266. 'order' => array('id' => 'desc'),
  267. 'col' => '*|mid|',
  268. ),
  269. ),
  270. );