member_shop_log.php 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287
  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. 'search' => 'hidden',
  142. ),
  143. 'state' => array
  144. (
  145. 'type' => 'tinyint-1',
  146. 'name' => '状态',
  147. 'default' => '1',
  148. 'desc' => '请选择状态',
  149. 'match' => 'is_numeric',
  150. ),
  151. 'cdate' => array
  152. (
  153. 'type' => 'int-11',
  154. 'name' => '归店时间',
  155. 'match' => array('is_numeric', time()),
  156. 'desc' => '',
  157. # 只有insert时才生效
  158. 'insert' => true,
  159. 'search' => $search_auth == 1 ? 'month' : 'date',
  160. 'list' => 'date("Y-m-d H:i", {cdate})',
  161. //'order' => 'desc',
  162. ),
  163. ),
  164. 'manage' => array
  165. (
  166. 'edit' => false,
  167. 'insert' => false,
  168. 'delete' => false,
  169. 'excel' => $excel,
  170. ),
  171. 'request' => array
  172. (
  173. 'list' => array
  174. (
  175. # 匹配的正则或函数 选填项
  176. 'option' => array
  177. (
  178. 'mid' => array('yes-t_1.mid', 'in'),
  179. 'start_cdate' => array('yes-t_1.cdate','>='),
  180. 'end_cdate' => array('yes-t_1.cdate','<='),
  181. 'new_shop_id' => 'yes-t_1.new_shop_id',
  182. 'agent-member-role' => 'yes-t_2.role',
  183. 'status' => 'yes-t_1.status',
  184. 'state' => 'yes-t_1.state-1',
  185. ),
  186. 'join' => array
  187. (
  188. array
  189. (
  190. 'table' => 'agent/member',
  191. 'type' => 'left join',
  192. 'on' => array('mid','id'),
  193. 'col' => 't_2.id as mid',
  194. ),
  195. ),
  196. 'type' => 'all',
  197. 'group' => $group,
  198. 'order' => array('t_1.id' => 'desc'),
  199. 'page' => array(20, 'list'),
  200. 'col' => '*',
  201. ),
  202. 'getAll' => array
  203. (
  204. # 匹配的正则或函数 选填项
  205. 'option' => array
  206. (
  207. 'start' => array('yes-cdate','>='),
  208. 'end' => array('yes-cdate','<='),
  209. 'new_shop_id' => 'yes',
  210. 'state' => 1,
  211. ),
  212. 'type' => 'count',
  213. // 'order' => array('cdate' => 'desc'),
  214. 'col' => '*',
  215. ),
  216. 'getAllByShop' => array
  217. (
  218. # 匹配的正则或函数 选填项
  219. 'option' => array
  220. (
  221. 'start' => array('yes-cdate','>='),
  222. 'end' => array('yes-cdate','<='),
  223. 'new_shop_id' => 'yes',
  224. 'status' => 1,
  225. 'state' => 1,
  226. ),
  227. 'type' => 'all',
  228. // 'order' => array('cdate' => 'desc'),
  229. 'col' => '*|mid',
  230. ),
  231. 'getGui' => array
  232. (
  233. # 匹配的正则或函数 选填项
  234. 'option' => array
  235. (
  236. 'start' => array('yes-cdate','>='),
  237. 'end' => array('yes-cdate','<='),
  238. // 'new_shop_id' => 'yes',
  239. 'state' => 1,
  240. ),
  241. 'type' => 'all',
  242. 'order' => array('cdate' => 'asc'),
  243. 'col' => '*',
  244. ),
  245. 'getLog' => array
  246. (
  247. # 匹配的正则或函数 选填项
  248. 'option' => array
  249. (
  250. 'start' => array('yes-cdate','>='),
  251. 'end' => array('yes-cdate','<='),
  252. 'new_shop_id' => 'yes',
  253. 'state' => 1,
  254. ),
  255. 'type' => 'all',
  256. 'order' => array('cdate' => 'asc'),
  257. 'col' => '*',
  258. ),
  259. 'getData' => array
  260. (
  261. # 匹配的正则或函数 选填项
  262. 'option' => array
  263. (
  264. 'state' => 1,
  265. ),
  266. 'type' => 'all',
  267. 'order' => array('id' => 'desc'),
  268. 'col' => '*|mid|',
  269. ),
  270. ),
  271. );