member_shop_log.php 7.2 KB

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