member_shop_log.php 7.9 KB

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