cash.php 6.8 KB

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