sell.php 8.3 KB

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