cash.php 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291
  1. <?php
  2. /*
  3. $type = array
  4. (
  5. 1 => '期权账户',
  6. 2 => '原始期权账户',
  7. 3 => '岗位期权账户',
  8. 4 => '奖励期权账户',
  9. );
  10. */
  11. $type = function()
  12. {
  13. $array = array();
  14. $data = Dever::load('option/lib/manage.getQiquan');
  15. if($data)
  16. {
  17. $array += $data;
  18. }
  19. return $array;
  20. };
  21. return array
  22. (
  23. # 表名
  24. 'name' => 'cash',
  25. # 显示给用户看的名称
  26. 'lang' => '期权账户数据',
  27. 'order' => 100,
  28. 'menu' => false,
  29. 'config_type' => $type,
  30. # 数据结构
  31. 'struct' => array
  32. (
  33. 'id' => array
  34. (
  35. 'type' => 'int-11',
  36. 'name' => 'ID',
  37. 'default' => '',
  38. 'desc' => '',
  39. 'match' => 'is_numeric',
  40. 'search' => 'order',
  41. //'list' => true,
  42. ),
  43. 'type' => array
  44. (
  45. 'type' => 'tinyint-1',
  46. 'name' => '类型',
  47. 'default' => '1',
  48. 'desc' => '类型',
  49. 'match' => 'is_numeric',
  50. 'option' => $type,
  51. 'update' => 'radio',
  52. ),
  53. 'aid' => array
  54. (
  55. 'type' => 'int-11',
  56. 'name' => '主账号手机号',
  57. 'default' => '-1',
  58. 'desc' => '期权登录账户',
  59. 'match' => 'is_string',
  60. 'update' => 'text',
  61. 'search' => array
  62. (
  63. 'api' => 'option/member-getMain',
  64. 'col' => 'mobile',
  65. 'result' => 'aid',
  66. 'search' => 'aid',//本表的字段,默认为当前的字段
  67. ),
  68. 'list_name' => '主账户',
  69. 'list' => 'Dever::load("option/lib/account.getInfo", {aid})',
  70. 'list_order' => 3,
  71. ),
  72. 'mid' => array
  73. (
  74. 'type' => 'int-11',
  75. 'name' => '子账号手机号',
  76. 'default' => '-1',
  77. 'desc' => '期权账户',
  78. 'match' => 'is_string',
  79. 'update' => 'text',
  80. 'search' => array
  81. (
  82. 'api' => 'option/member-getChild',
  83. 'col' => 'mobile',
  84. 'result' => 'id',
  85. 'search' => 'mid',//本表的字段,默认为当前的字段
  86. ),
  87. 'list_name' => '子账户',
  88. 'list' => 'Dever::load("option/lib/member.getInfo", {mid})',
  89. 'list_order' => 3,
  90. ),
  91. 'daijiaofu_date' => array
  92. (
  93. 'type' => 'int-11',
  94. 'name' => '最新的交付时间',
  95. 'match' => 'is_numeric',
  96. 'desc' => '最新的交付时间',
  97. ),
  98. 'daijiaofu' => array
  99. (
  100. 'type' => 'decimal-11,2',
  101. 'name' => '待交付额度',
  102. 'default' => '0.00',
  103. 'desc' => '待交付额度',
  104. 'match' => 'is_numeric',
  105. //'update' => 'text',
  106. 'list' => true,
  107. ),
  108. 'jiaofu' => array
  109. (
  110. 'type' => 'decimal-11,2',
  111. 'name' => '已交付额度',
  112. 'default' => '0.00',
  113. 'desc' => '交付额度',
  114. 'match' => 'is_numeric',
  115. //'update' => 'text',
  116. 'list' => true,
  117. ),
  118. 'zuofei' => array
  119. (
  120. 'type' => 'decimal-11,2',
  121. 'name' => '作废额度',
  122. 'default' => '0.00',
  123. 'desc' => '作废额度',
  124. 'match' => 'is_numeric',
  125. //'update' => 'text',
  126. 'list' => true,
  127. ),
  128. 'fafang' => array
  129. (
  130. 'type' => 'decimal-11,2',
  131. 'name' => '发放额度',
  132. 'default' => '0.00',
  133. 'desc' => '发放额度',
  134. 'match' => 'is_numeric',
  135. //'update' => 'text',
  136. 'list' => true,
  137. ),
  138. 'duifu' => array
  139. (
  140. 'type' => 'decimal-11,2',
  141. 'name' => '兑付额度',
  142. 'default' => '0.00',
  143. 'desc' => '兑付额度',
  144. 'match' => 'is_numeric',
  145. //'update' => 'text',
  146. 'list' => true,
  147. ),
  148. 'state' => array
  149. (
  150. 'type' => 'tinyint-1',
  151. 'name' => '状态',
  152. 'default' => '1',
  153. 'desc' => '请选择状态',
  154. 'match' => 'is_numeric',
  155. ),
  156. 'cdate' => array
  157. (
  158. 'type' => 'int-11',
  159. 'name' => '创建时间',
  160. 'match' => array('is_numeric', time()),
  161. 'desc' => '',
  162. # 只有insert时才生效
  163. 'insert' => true,
  164. 'search' => 'date',
  165. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  166. 'list_order' => 2,
  167. ),
  168. ),
  169. 'alter' => array
  170. (
  171. 5 => array
  172. (
  173. array('update', 'daijiaofu', 'daijiaofu', 'decimal-11,2 0 待交付额度'),
  174. array('update', 'jiaofu', 'jiaofu', 'decimal-11,2 0 已交付额度'),
  175. array('update', 'fafang', 'fafang', 'decimal-11,2 0 发放额度'),
  176. array('update', 'duifu', 'duifu', 'decimal-11,2 0 兑付额度'),
  177. ),
  178. 'version' => 5,
  179. ),
  180. 'manage' => array
  181. (
  182. 'insert' => false,
  183. 'delete' => false,
  184. 'edit' => false,
  185. 'page_list' => 'cash',
  186. ),
  187. 'request' => array
  188. (
  189. 'getTotal' => array
  190. (
  191. 'type' => 'all',
  192. 'option' => array
  193. (
  194. 'id' => 'yes',
  195. 'aid' => 'yes',
  196. 'mid' => 'yes',
  197. 'state' => 1,
  198. ),
  199. 'group' => 'type',
  200. 'order' => array('daijiaofu_date' => 'desc', 'id' => 'desc'),
  201. 'col' => '*,sum(daijiaofu) as daijiaofu, sum(jiaofu) as jiaofu, sum(fafang) as fafang, sum(duifu) as duifu, sum(zuofei) as zuofei|type',
  202. ),
  203. 'upCash_daijiaofu' => array
  204. (
  205. 'type' => 'update',
  206. 'where' => array
  207. (
  208. 'id' => 'yes',
  209. ),
  210. 'set' => array
  211. (
  212. 'cash' => array('yes-daijiaofu', '+='),
  213. 'daijiaofu_date' => 'yes',
  214. ),
  215. ),
  216. 'upCash_jiaofu' => array
  217. (
  218. 'type' => 'update',
  219. 'where' => array
  220. (
  221. 'id' => 'yes',
  222. ),
  223. 'set' => array
  224. (
  225. 'cash' => array('yes-jiaofu', '+='),
  226. ),
  227. ),
  228. 'upCash_fafang' => array
  229. (
  230. 'type' => 'update',
  231. 'where' => array
  232. (
  233. 'id' => 'yes',
  234. ),
  235. 'set' => array
  236. (
  237. 'cash' => array('yes-fafang', '+='),
  238. 'jiaofu' => array('yes', '-='),
  239. ),
  240. ),
  241. 'upCash_zuofei' => array
  242. (
  243. 'type' => 'update',
  244. 'where' => array
  245. (
  246. 'id' => 'yes',
  247. ),
  248. 'set' => array
  249. (
  250. 'cash' => array('yes-zuofei', '+='),
  251. 'jiaofu' => array('yes', '-='),
  252. ),
  253. ),
  254. 'upCash_duifu' => array
  255. (
  256. 'type' => 'update',
  257. 'where' => array
  258. (
  259. 'id' => 'yes',
  260. ),
  261. 'set' => array
  262. (
  263. 'cash' => array('yes-duifu', '+='),
  264. 'fafang' => array('yes', '-='),
  265. ),
  266. ),
  267. ),
  268. );