sell.php 9.9 KB

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