sell.php 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285
  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. 'agent-member-name'=> array
  81. (
  82. 'name' => '姓名',
  83. 'default' => '',
  84. 'desc' => '姓名',
  85. 'match' => 'option',
  86. # 读取另外表的关联方式
  87. 'sync' => array('mid', 'id'),
  88. // 'search' => 'fulltext',
  89. 'searchs' => array
  90. (
  91. 'api' => 'agent/member-find',
  92. 'col' => 'name',
  93. 'result' => 'id',
  94. 'search' => 'mid',
  95. ),
  96. ),
  97. 'agent-member-role'=> array
  98. (
  99. 'name' => '代理角色',
  100. 'default' => '',
  101. 'desc' => '代理角色',
  102. 'match' => 'option',
  103. # 读取另外表的关联方式
  104. 'sync' => array('mid', 'id'),
  105. // 'list' => 'Dever::load("setting/role-find#name", "{agent-member-role}")',
  106. // 'list_order' => 5,
  107. ),
  108. 'order_num' => array
  109. (
  110. 'type' => 'varchar-100',
  111. 'name' => '流水号',
  112. 'default' => '',
  113. 'desc' => '流水号',
  114. 'match' => 'is_string',
  115. 'update' => 'text',
  116. //'search' => 'fulltext',
  117. //'list' => true,
  118. //'list_order' => 1,
  119. ),
  120. 'type' => array
  121. (
  122. 'type' => 'int-11',
  123. 'name' => '业绩类型',
  124. 'default' => '1',
  125. 'desc' => '业绩类型',
  126. 'match' => 'is_numeric',
  127. 'search' => 'select',
  128. 'update' => 'checkbox',
  129. 'option' => $type,
  130. 'list' => true,
  131. 'list_order' => 7,
  132. ),
  133. 'stype' => array
  134. (
  135. 'type' => 'int-11',
  136. 'name' => '发放类型',
  137. 'default' => '1',
  138. 'desc' => '发放类型',
  139. 'match' => 'is_numeric',
  140. 'search' => 'select',
  141. 'update' => 'checkbox',
  142. 'option' => $stype,
  143. 'list' => true,
  144. 'list_order' => 8,
  145. ),
  146. 'type_id' => array
  147. (
  148. 'type' => 'int-11',
  149. 'name' => '交易来源id',
  150. 'default' => '',
  151. 'desc' => '交易来源id',
  152. 'match' => 'is_string',
  153. 'update' => 'text',
  154. ),
  155. 'role' => array
  156. (
  157. 'type' => 'int-11',
  158. 'name' => '代理角色',
  159. 'default' => '',
  160. 'desc' => '代理角色',
  161. 'match' => 'is_numeric',
  162. //'search' => 'select',
  163. 'update' => 'checkbox',
  164. 'option' => $role,
  165. //'list' => true,
  166. ),
  167. 'num' => array
  168. (
  169. 'type' => 'decimal-11,2',
  170. 'name' => '业绩金额',
  171. 'default' => '0',
  172. 'desc' => '业绩',
  173. 'match' => 'is_numeric',
  174. 'update' => 'text',
  175. 'list' => true,
  176. ),
  177. 'desc' => array
  178. (
  179. 'type' => 'varchar-600',
  180. 'name' => '业绩说明',
  181. 'default' => '',
  182. 'desc' => '业绩说明',
  183. 'match' => 'is_string',
  184. 'update' => 'text',
  185. ),
  186. 'state' => array
  187. (
  188. 'type' => 'tinyint-1',
  189. 'name' => '状态',
  190. 'default' => '1',
  191. 'desc' => '请选择状态',
  192. 'match' => 'is_numeric',
  193. ),
  194. 'cdate' => array
  195. (
  196. 'type' => 'int-11',
  197. 'name' => '交易时间',
  198. 'match' => array('is_numeric', time()),
  199. 'desc' => '',
  200. # 只有insert时才生效
  201. 'insert' => true,
  202. 'search' => 'date',
  203. 'list' => 'date("Y-m-d H:i", {cdate})',
  204. 'list_order' => 20,
  205. ),
  206. ),
  207. 'manage' => array
  208. (
  209. 'insert' => false,
  210. 'delete' => false,
  211. 'edit' => false,
  212. 'button' => $button,
  213. 'list_button' => array
  214. (
  215. 'list' => array('查看详情', '"push_sell&project=bill&id={id}&page_type=1"'),
  216. ),
  217. ),
  218. 'request' => array
  219. (
  220. 'getData' => array
  221. (
  222. # 匹配的正则或函数 选填项
  223. 'option' => array
  224. (
  225. 'mid' => 'yes',
  226. 'type' => 'yes',
  227. 'state' => 1,
  228. ),
  229. 'order' => array('id' => 'desc'),
  230. 'page' => array(10, 'list'),
  231. 'type' => 'all',
  232. 'col' => '*',
  233. ),
  234. 'getNumByTime' => array
  235. (
  236. # 匹配的正则或函数 选填项
  237. 'option' => array
  238. (
  239. 'start' => array('yes-cdate', '>='),
  240. 'end' => array('yes-cdate', '<='),
  241. 'type' => 'yes',
  242. 'state' => 1,
  243. ),
  244. 'type' => 'all',
  245. 'group' => 'mid,type',
  246. 'col' => '*,sum(num) as num',
  247. ),
  248. 'getNumByTimeOne' => array
  249. (
  250. # 匹配的正则或函数 选填项
  251. 'option' => array
  252. (
  253. // 'start' => array('yes-cdate', '>='),
  254. 'end' => array('yes-cdate', '<='),
  255. 'mid' => 'yes',
  256. 'stype' => 'yes',
  257. 'type' => 'yes',
  258. 'state' => 1,
  259. ),
  260. 'type' => 'one',
  261. 'col' => '*,sum(num) as num',
  262. ),
  263. ),
  264. );