sell.php 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279
  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
  16. (
  17. '返回上一页' => array('location', 'l=project/database/list&project=agent&table=member_area&page_type=1&mid=' . $mid),
  18. '发放业绩' => array('fast', '', 'push_sell&search_option_mid=' . $mid),
  19. );
  20. }
  21. $type = array
  22. (
  23. 1 => '直推业绩',
  24. 2 => '团队业绩',
  25. );
  26. $ftype = array
  27. (
  28. 1 => '自动发放',
  29. 2 => '手动发放',
  30. );
  31. return array
  32. (
  33. # 表名
  34. 'name' => 'sell',
  35. # 显示给用户看的名称
  36. 'lang' => '业绩流水',
  37. 'order' => 90,
  38. 'set' => array
  39. (
  40. 'type' => $type,
  41. ),
  42. # 数据结构
  43. 'struct' => array
  44. (
  45. 'id' => array
  46. (
  47. 'type' => 'int-11',
  48. 'name' => 'ID',
  49. 'default' => '',
  50. 'desc' => '',
  51. 'match' => 'is_numeric',
  52. 'search' => 'order',
  53. //'list' => true,
  54. ),
  55. 'mid' => array
  56. (
  57. 'type' => 'int-11',
  58. 'name' => '手机号',
  59. 'default' => '-1',
  60. 'desc' => '代理商',
  61. 'match' => 'is_string',
  62. 'update' => 'text',
  63. 'search' => $mid ? 'hidden' : array
  64. (
  65. 'api' => 'agent/member-find',
  66. 'col' => 'mobile',
  67. 'result' => 'id',
  68. ),
  69. 'list_name' => '手机号',
  70. 'list' => 'Dever::load("agent/member-find#mobile", {mid})',
  71. 'list_order' => 4,
  72. ),
  73. 'agent-member-name'=> array
  74. (
  75. 'name' => '姓名',
  76. 'default' => '',
  77. 'desc' => '姓名',
  78. 'match' => 'option',
  79. # 读取另外表的关联方式
  80. 'sync' => array('mid', 'id'),
  81. // 'search' => 'fulltext',
  82. 'search' => array
  83. (
  84. 'api' => 'agent/member-find',
  85. 'col' => 'name',
  86. 'result' => 'id',
  87. 'search' => 'mid',
  88. ),
  89. 'list' => true,
  90. 'list_order' => 3,
  91. ),
  92. 'agent-member-role'=> array
  93. (
  94. 'name' => '代理角色',
  95. 'default' => '',
  96. 'desc' => '代理角色',
  97. 'match' => 'option',
  98. # 读取另外表的关联方式
  99. 'sync' => array('mid', 'id'),
  100. 'list' => 'Dever::load("setting/role-find#name", "{agent-member-role}")',
  101. 'list_order' => 5,
  102. ),
  103. 'order_num' => array
  104. (
  105. 'type' => 'varchar-100',
  106. 'name' => '流水号',
  107. 'default' => '',
  108. 'desc' => '流水号',
  109. 'match' => 'is_string',
  110. 'update' => 'text',
  111. 'search' => 'fulltext',
  112. 'list' => true,
  113. 'list_order' => 1,
  114. ),
  115. 'type' => array
  116. (
  117. 'type' => 'int-11',
  118. 'name' => '业绩类型',
  119. 'default' => '1',
  120. 'desc' => '业绩类型',
  121. 'match' => 'is_numeric',
  122. 'search' => 'select',
  123. 'update' => 'checkbox',
  124. 'option' => $type,
  125. 'list' => true,
  126. 'list_order' => 7,
  127. ),
  128. 'stype' => array
  129. (
  130. 'type' => 'int-11',
  131. 'name' => '发放类型',
  132. 'default' => '1',
  133. 'desc' => '发放类型',
  134. 'match' => 'is_numeric',
  135. 'search' => 'select',
  136. 'update' => 'checkbox',
  137. 'option' => $stype,
  138. 'list' => true,
  139. 'list_order' => 8,
  140. ),
  141. 'type_id' => array
  142. (
  143. 'type' => 'int-11',
  144. 'name' => '交易来源id',
  145. 'default' => '',
  146. 'desc' => '交易来源id',
  147. 'match' => 'is_string',
  148. 'update' => 'text',
  149. ),
  150. 'role' => array
  151. (
  152. 'type' => 'int-11',
  153. 'name' => '代理角色',
  154. 'default' => '',
  155. 'desc' => '代理角色',
  156. 'match' => 'is_numeric',
  157. //'search' => 'select',
  158. 'update' => 'checkbox',
  159. 'option' => $role,
  160. //'list' => true,
  161. ),
  162. 'num' => array
  163. (
  164. 'type' => 'float-11,2',
  165. 'name' => '业绩金额',
  166. 'default' => '0',
  167. 'desc' => '业绩',
  168. 'match' => 'is_numeric',
  169. 'update' => 'text',
  170. 'list' => true,
  171. ),
  172. 'desc' => array
  173. (
  174. 'type' => 'varchar-600',
  175. 'name' => '业绩说明',
  176. 'default' => '',
  177. 'desc' => '业绩说明',
  178. 'match' => 'is_string',
  179. 'update' => 'text',
  180. ),
  181. 'state' => array
  182. (
  183. 'type' => 'tinyint-1',
  184. 'name' => '状态',
  185. 'default' => '1',
  186. 'desc' => '请选择状态',
  187. 'match' => 'is_numeric',
  188. ),
  189. 'cdate' => array
  190. (
  191. 'type' => 'int-11',
  192. 'name' => '交易时间',
  193. 'match' => array('is_numeric', time()),
  194. 'desc' => '',
  195. # 只有insert时才生效
  196. //'insert' => true,
  197. 'search' => 'date',
  198. 'list' => 'date("Y-m-d H:i", {cdate})',
  199. 'list_order' => 2,
  200. ),
  201. ),
  202. 'manage' => array
  203. (
  204. 'insert' => false,
  205. 'delete' => false,
  206. 'edit' => false,
  207. 'button' => $button,
  208. 'list_button' => array
  209. (
  210. 'list' => array('查看详情', '"push_sell&project=bill&id={id}&page_type=1"'),
  211. ),
  212. ),
  213. 'request' => array
  214. (
  215. 'getData' => array
  216. (
  217. # 匹配的正则或函数 选填项
  218. 'option' => array
  219. (
  220. 'mid' => 'yes',
  221. 'type' => 'yes',
  222. 'state' => 1,
  223. ),
  224. 'order' => array('id' => 'desc'),
  225. 'page' => array(10, 'list'),
  226. 'type' => 'all',
  227. 'col' => '*',
  228. ),
  229. 'getNumByTime' => array
  230. (
  231. # 匹配的正则或函数 选填项
  232. 'option' => array
  233. (
  234. 'start' => array('yes-cdate', '>='),
  235. 'end' => array('yes-cdate', '<='),
  236. 'type' => array('yes', 'in'),
  237. 'state' => 1,
  238. ),
  239. 'type' => 'all',
  240. 'group' => 'mid',
  241. 'col' => '*,sum(num) as num',
  242. ),
  243. 'getNumByTimeOne' => array
  244. (
  245. # 匹配的正则或函数 选填项
  246. 'option' => array
  247. (
  248. //'start' => array('yes-cdate', '>='),
  249. 'end' => array('yes-cdate', '<='),
  250. 'mid' => 'yes',
  251. //'type' => array('yes', 'in'),
  252. 'state' => 1,
  253. ),
  254. 'type' => 'one',
  255. 'col' => '*,sum(num) as num',
  256. ),
  257. ),
  258. );