cash.php 6.9 KB

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