sell.php 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373
  1. <?php
  2. $role = function()
  3. {
  4. $array = array();
  5. $data = Dever::load('setting/lib/manage.role');
  6. if($data)
  7. {
  8. $array += $data;
  9. }
  10. return $array;
  11. };
  12. $mid = Dever::input('search_option_mid');
  13. $button = array();
  14. if ($mid) {
  15. $button['返回上一页'] = array('location', 'l=project/database/list&project=agent&table=member_area&page_type=1&mid=' . $mid . '&[refer]');
  16. if (Dever::load('manage/auth')->checkFunc('agent.member', 'edit2', '发放业绩')) {
  17. $button['发放业绩'] = array('fast', '', 'push_sell&search_option_mid=' . $mid);
  18. }
  19. // $button = array
  20. // (
  21. // '返回上一页' => array('location', 'l=project/database/list&project=agent&table=member_area&page_type=1&mid=' . $mid),
  22. // '发放业绩' => array('fast', '', 'push_sell&search_option_mid=' . $mid),
  23. // );
  24. }
  25. $excel = false;
  26. if (Dever::load('manage/auth')->checkFunc('bill.sell', 'auditsell', '业绩流水导出')) {
  27. $excel[] = array('数据导出', '业绩流水导出', 'bill/lib/sell.out_sell');
  28. }
  29. $type = array
  30. (
  31. 1 => '直推业绩',
  32. 2 => '团队业绩',
  33. //3 => '间推业绩',
  34. );
  35. $stype = array
  36. (
  37. 1 => '自动发放',
  38. 2 => '手动发放',
  39. 3 => '旧系统导入',
  40. 4 => '自动补发',
  41. );
  42. $admin = Dever::load('manage/auth.info');
  43. $admin_auth = false;
  44. if ($admin && $admin['role'] == 24){
  45. $admin_auth = $admin['role'];
  46. }
  47. return array
  48. (
  49. # 表名
  50. 'name' => 'sell',
  51. # 显示给用户看的名称
  52. 'lang' => '业绩流水',
  53. 'order' => 90,
  54. 'set' => array
  55. (
  56. 'type' => $type,
  57. 'stype' => $stype,
  58. ),
  59. # 数据结构
  60. 'struct' => array
  61. (
  62. 'id' => array
  63. (
  64. 'type' => 'int-11',
  65. 'name' => 'ID',
  66. 'default' => '',
  67. 'desc' => '',
  68. 'match' => 'is_numeric',
  69. 'search' => 'order',
  70. //'list' => true,
  71. ),
  72. 'mid' => array
  73. (
  74. 'type' => 'int-11',
  75. 'name' => '代理商姓名/手机号',
  76. 'default' => '-1',
  77. 'desc' => '代理商',
  78. 'match' => 'is_string',
  79. 'update' => 'text',
  80. 'search' => array
  81. (
  82. 'api' => 'agent/member-getSearch',
  83. 'col' => 'col',
  84. 'result' => 'id',
  85. 'search' => 'mid',
  86. ),
  87. 'list_name' => '代理商信息',
  88. 'list' => $admin_auth ? 'Dever::load("agent/lib/member.getOne", {mid}, "agent/member", true,true)' : 'Dever::load("agent/lib/member.getOne", {mid}, "agent/member", true)',
  89. 'list_order' => 1,
  90. ),
  91. 'child_mid' => array
  92. (
  93. 'type' => 'int-11',
  94. 'name' => '直推组',
  95. 'default' => '-1',
  96. 'desc' => '直推组',
  97. 'match' => 'is_string',
  98. 'update' => 'text',
  99. 'list' => 'Dever::load("agent/lib/member.getOne", {child_mid}, "agent/member", true)',
  100. 'list_order' => 2,
  101. ),
  102. 'agent-member-name'=> array
  103. (
  104. 'name' => '姓名',
  105. 'default' => '',
  106. 'desc' => '姓名',
  107. 'match' => 'option',
  108. # 读取另外表的关联方式
  109. 'sync' => array('mid', 'id'),
  110. // 'search' => 'fulltext',
  111. 'searchs' => array
  112. (
  113. 'api' => 'agent/member-find',
  114. 'col' => 'name',
  115. 'result' => 'id',
  116. 'search' => 'mid',
  117. ),
  118. ),
  119. 'agent-member-role'=> array
  120. (
  121. 'name' => '代理角色',
  122. 'default' => '',
  123. 'desc' => '代理角色',
  124. 'match' => 'option',
  125. # 读取另外表的关联方式
  126. 'sync' => array('mid', 'id'),
  127. // 'list' => 'Dever::load("setting/role-find#name", "{agent-member-role}")',
  128. // 'list_order' => 5,
  129. ),
  130. 'order_num' => array
  131. (
  132. 'type' => 'varchar-100',
  133. 'name' => '流水号',
  134. 'default' => '',
  135. 'desc' => '流水号',
  136. 'match' => 'is_string',
  137. 'update' => 'text',
  138. //'search' => 'fulltext',
  139. //'list' => true,
  140. //'list_order' => 1,
  141. ),
  142. 'type' => array
  143. (
  144. 'type' => 'int-11',
  145. 'name' => '业绩类型',
  146. 'default' => '1',
  147. 'desc' => '业绩类型',
  148. 'match' => 'is_numeric',
  149. 'search' => 'select',
  150. 'update' => 'checkbox',
  151. 'option' => $type,
  152. 'list' => true,
  153. 'list_order' => 7,
  154. ),
  155. 'stype' => array
  156. (
  157. 'type' => 'int-11',
  158. 'name' => '发放类型',
  159. 'default' => '1',
  160. 'desc' => '发放类型',
  161. 'match' => 'is_numeric',
  162. 'search' => 'select',
  163. 'update' => 'checkbox',
  164. 'option' => $stype,
  165. 'list' => true,
  166. 'list_order' => 8,
  167. ),
  168. 'type_id' => array
  169. (
  170. 'type' => 'int-11',
  171. 'name' => '交易来源id',
  172. 'default' => '',
  173. 'desc' => '交易来源id',
  174. 'match' => 'is_string',
  175. 'update' => 'text',
  176. ),
  177. 'role' => array
  178. (
  179. 'type' => 'int-11',
  180. 'name' => '代理角色',
  181. 'default' => '',
  182. 'desc' => '代理角色',
  183. 'match' => 'is_numeric',
  184. //'search' => 'select',
  185. 'update' => 'checkbox',
  186. 'option' => $role,
  187. //'list' => true,
  188. ),
  189. 'num' => array
  190. (
  191. 'type' => 'decimal-11,2',
  192. 'name' => '业绩金额',
  193. 'default' => '0',
  194. 'desc' => '业绩',
  195. 'match' => 'is_numeric',
  196. 'update' => 'text',
  197. 'list' => true,
  198. ),
  199. 'desc' => array
  200. (
  201. 'type' => 'varchar-600',
  202. 'name' => '业绩说明',
  203. 'default' => '',
  204. 'desc' => '业绩说明',
  205. 'match' => 'is_string',
  206. 'update' => 'text',
  207. 'list' => true,
  208. ),
  209. 'state' => array
  210. (
  211. 'type' => 'tinyint-1',
  212. 'name' => '状态',
  213. 'default' => '1',
  214. 'desc' => '请选择状态',
  215. 'match' => 'is_numeric',
  216. ),
  217. 'cdate' => array
  218. (
  219. 'type' => 'int-11',
  220. 'name' => '交易时间',
  221. 'match' => array('is_numeric', time()),
  222. 'desc' => '',
  223. # 只有insert时才生效
  224. 'insert' => true,
  225. 'search' => 'date',
  226. 'list' => 'date("Y-m-d H:i", {cdate})',
  227. 'list_order' => 20,
  228. ),
  229. ),
  230. 'manage' => array
  231. (
  232. 'insert' => false,
  233. 'delete' => false,
  234. 'edit' => false,
  235. 'button' => $button,
  236. 'excel' => $excel,
  237. 'list_button' => array
  238. (
  239. 'list' => array('查看详情', '"push_sell&project=bill&id={id}&page_type=1"'),
  240. ),
  241. ),
  242. 'request' => array
  243. (
  244. 'getData' => array
  245. (
  246. # 匹配的正则或函数 选填项
  247. 'option' => array
  248. (
  249. 'mid' => 'yes',
  250. 'type' => 'yes',
  251. 'state' => 1,
  252. ),
  253. 'order' => array('id' => 'desc'),
  254. 'page' => array(10, 'list'),
  255. 'type' => 'all',
  256. 'col' => '*',
  257. ),
  258. 'getNumByTime' => array
  259. (
  260. # 匹配的正则或函数 选填项
  261. 'option' => array
  262. (
  263. 'start' => array('yes-cdate', '>='),
  264. 'end' => array('yes-cdate', '<='),
  265. 'type' => 'yes',
  266. 'state' => 1,
  267. ),
  268. 'type' => 'all',
  269. 'group' => 'mid,type',
  270. 'col' => '*,sum(num) as num',
  271. ),
  272. 'getNumByTimeOne' => array
  273. (
  274. # 匹配的正则或函数 选填项
  275. 'option' => array
  276. (
  277. // 'start' => array('yes-cdate', '>='),
  278. 'end' => array('yes-cdate', '<='),
  279. 'mid' => 'yes',
  280. 'stype' => 'yes',
  281. 'type' => 'yes',
  282. 'state' => 1,
  283. ),
  284. 'type' => 'one',
  285. 'col' => '*,sum(num) as num',
  286. ),
  287. 'getNewParent' => array
  288. (
  289. # 匹配的正则或函数 选填项
  290. 'option' => array
  291. (
  292. 'start' => array('yes-cdate','>='),
  293. 'end' => array('yes-cdate','<='),
  294. 'mid' => 'yes',
  295. 'type' => 'yes',
  296. 'stype' => 'yes',
  297. 'state' => 1,
  298. ),
  299. 'type' => 'one',
  300. 'col' => 'sum(num) as total',
  301. ),
  302. 'getNewChildParent' => array
  303. (
  304. # 匹配的正则或函数 选填项
  305. 'option' => array
  306. (
  307. 'start' => array('yes-cdate','>='),
  308. 'end' => array('yes-cdate','<='),
  309. 'mid' => 'yes',
  310. 'type' => 'yes',
  311. 'stype' => 'yes',
  312. 'state' => 1,
  313. ),
  314. // 'group' => 'child_mid',
  315. 'type' => 'one',
  316. 'col' => 'child_mid,sum(num) as total',
  317. ),
  318. 'childOne' => array
  319. (
  320. # 匹配的正则或函数 选填项
  321. 'option' => array
  322. (
  323. 'start' => array('yes-cdate','>='),
  324. 'end' => array('yes-cdate','<='),
  325. 'mid' => 'yes',
  326. 'type' => 'yes',
  327. 'stype' => 'yes',
  328. 'state' => 1,
  329. ),
  330. // 'group' => 'child_mid',
  331. 'type' => 'one',
  332. 'col' => 'child_mid,max(num) as total',
  333. ),
  334. 'getChildData' => array
  335. (
  336. # 匹配的正则或函数 选填项
  337. 'option' => array
  338. (
  339. //'child_mid' => -1,
  340. 'stype' => 1,
  341. 'state' => 1,
  342. ),
  343. 'order' => array('id' => 'desc'),
  344. 'type' => 'all',
  345. 'limit' => '0,10000',
  346. 'col' => '*',
  347. ),
  348. ),
  349. );