sell.php 7.0 KB

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