sell.php 10 KB

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