sell.php 7.7 KB

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