sell.php 9.2 KB

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