sell.php 11 KB

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