cash.php 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266
  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. 'fafang' => 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. 'duifu' => 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. 'state' => array
  139. (
  140. 'type' => 'tinyint-1',
  141. 'name' => '状态',
  142. 'default' => '1',
  143. 'desc' => '请选择状态',
  144. 'match' => 'is_numeric',
  145. ),
  146. 'cdate' => array
  147. (
  148. 'type' => 'int-11',
  149. 'name' => '创建时间',
  150. 'match' => array('is_numeric', time()),
  151. 'desc' => '',
  152. # 只有insert时才生效
  153. 'insert' => true,
  154. 'search' => 'date',
  155. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  156. 'list_order' => 2,
  157. ),
  158. ),
  159. 'alter' => array
  160. (
  161. 5 => array
  162. (
  163. array('update', 'daijiaofu', 'daijiaofu', 'decimal-11,2 0 待交付额度'),
  164. array('update', 'jiaofu', 'jiaofu', 'decimal-11,2 0 已交付额度'),
  165. array('update', 'fafang', 'fafang', 'decimal-11,2 0 发放额度'),
  166. array('update', 'duifu', 'duifu', 'decimal-11,2 0 兑付额度'),
  167. ),
  168. 'version' => 5,
  169. ),
  170. 'manage' => array
  171. (
  172. 'insert' => false,
  173. 'delete' => false,
  174. 'edit' => false,
  175. 'page_list' => 'cash',
  176. ),
  177. 'request' => array
  178. (
  179. 'getTotal' => array
  180. (
  181. 'type' => 'all',
  182. 'option' => array
  183. (
  184. 'id' => 'yes',
  185. 'aid' => 'yes',
  186. 'mid' => 'yes',
  187. 'state' => 1,
  188. ),
  189. 'group' => 'type',
  190. 'order' => array('daijiaofu_date' => 'desc', 'id' => 'desc'),
  191. 'col' => '*,sum(daijiaofu) as daijiaofu, sum(jiaofu) as jiaofu, sum(fafang) as fafang, sum(duifu) as duifu|type',
  192. ),
  193. 'upCash_daijiaofu' => array
  194. (
  195. 'type' => 'update',
  196. 'where' => array
  197. (
  198. 'id' => 'yes',
  199. ),
  200. 'set' => array
  201. (
  202. 'cash' => array('yes-daijiaofu', '+='),
  203. 'daijiaofu_date' => 'yes',
  204. ),
  205. ),
  206. 'upCash_jiaofu' => array
  207. (
  208. 'type' => 'update',
  209. 'where' => array
  210. (
  211. 'id' => 'yes',
  212. ),
  213. 'set' => array
  214. (
  215. 'cash' => array('yes-jiaofu', '+='),
  216. ),
  217. ),
  218. 'upCash_fafang' => array
  219. (
  220. 'type' => 'update',
  221. 'where' => array
  222. (
  223. 'id' => 'yes',
  224. ),
  225. 'set' => array
  226. (
  227. 'cash' => array('yes-fafang', '+='),
  228. 'jiaofu' => array('yes', '-='),
  229. ),
  230. ),
  231. 'upCash_duifu' => array
  232. (
  233. 'type' => 'update',
  234. 'where' => array
  235. (
  236. 'id' => 'yes',
  237. ),
  238. 'set' => array
  239. (
  240. 'cash' => array('yes-duifu', '+='),
  241. 'fafang' => array('yes', '-='),
  242. ),
  243. ),
  244. ),
  245. );