sell.php 10 KB

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