profit.php 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. <?php
  2. return array
  3. (
  4. # 表名
  5. 'name' => 'profit',
  6. # 显示给用户看的名称
  7. 'lang' => '用户收益列表',
  8. 'order' => 100,
  9. 'menu' => false,
  10. # 数据结构
  11. 'struct' => array
  12. (
  13. 'id' => array
  14. (
  15. 'type' => 'int-11',
  16. 'name' => 'ID',
  17. 'default' => '',
  18. 'desc' => '',
  19. 'match' => 'is_numeric',
  20. //'list' => true,
  21. ),
  22. 'uid' => array
  23. (
  24. 'type' => 'int-11',
  25. 'name' => '用户信息',
  26. 'default' => '0',
  27. 'desc' => '用户信息',
  28. 'match' => 'is_numeric',
  29. 'list' => 'Dever::load("account/lib/project.getUsername", {uid}, {config_id})',
  30. ),
  31. 'config_id' => array
  32. (
  33. 'type' => 'int-11',
  34. 'name' => '账户名称',
  35. 'default' => '1',
  36. 'desc' => '账户名称',
  37. 'match' => 'is_numeric',
  38. 'list' => 'account/config-one#name',
  39. 'value' => Dever::input('set_config_id'),
  40. ),
  41. 'project_id' => array
  42. (
  43. 'type' => 'int-11',
  44. 'name' => '所属项目',
  45. 'default' => '1',
  46. 'desc' => '所属项目',
  47. 'match' => 'is_numeric',
  48. 'list' => 'account/config_project-one#name',
  49. ),
  50. 'config_profit_id' => array
  51. (
  52. 'type' => 'int-11',
  53. 'name' => '所属收益',
  54. 'default' => '1',
  55. 'desc' => '所属收益',
  56. 'match' => 'is_numeric',
  57. 'list' => 'account/config_profit-one#name',
  58. ),
  59. 'cash' => array
  60. (
  61. 'type' => 'decimal-11,2',
  62. 'name' => '总金额',
  63. 'default' => '0',
  64. 'desc' => '总金额',
  65. 'match' => 'option',
  66. 'update' => 'text',
  67. 'list_name' => '未结算',
  68. 'list' => '{cash}-{ycash}',
  69. ),
  70. 'ycash' => array
  71. (
  72. 'type' => 'decimal-11,2',
  73. 'name' => '已结算',
  74. 'default' => '0',
  75. 'desc' => '已结算',
  76. 'match' => 'option',
  77. 'update' => 'text',
  78. 'list' => true,
  79. ),
  80. 'state' => array
  81. (
  82. 'type' => 'tinyint-1',
  83. 'name' => '状态',
  84. 'default' => '1',
  85. 'desc' => '请选择状态',
  86. 'match' => 'is_numeric',
  87. ),
  88. 'cdate' => array
  89. (
  90. 'type' => 'int-11',
  91. 'name' => '录入时间',
  92. 'match' => array('is_numeric', time()),
  93. 'desc' => '',
  94. # 只有insert时才生效
  95. 'insert' => true,
  96. ),
  97. ),
  98. # 索引
  99. 'index' => array
  100. (
  101. 1 => array
  102. (
  103. 'search' => 'uid,config_id,project_id,config_profit_id',
  104. ),
  105. # 版本号 更改版本号会更新当前表的索引
  106. 'version' => 1,
  107. ),
  108. 'manage' => array
  109. (
  110. 'delete' => false,
  111. 'edit' => false,
  112. 'insert' => false,
  113. ),
  114. # request 请求接口定义
  115. 'request' => array
  116. (
  117. # 更新
  118. 'incCash' => array
  119. (
  120. 'type' => 'update',
  121. 'where' => array
  122. (
  123. 'id' => 'yes',
  124. ),
  125. 'set' => array
  126. (
  127. 'cash' => array('yes', '+='),
  128. ),
  129. ),
  130. # 更新
  131. 'incYcash' => array
  132. (
  133. 'type' => 'update',
  134. 'where' => array
  135. (
  136. 'id' => 'yes',
  137. ),
  138. 'set' => array
  139. (
  140. 'ycash' => array('yes', '+='),
  141. ),
  142. ),
  143. # 更新
  144. 'incTcash' => array
  145. (
  146. 'type' => 'update',
  147. 'where' => array
  148. (
  149. 'id' => 'yes',
  150. ),
  151. 'set' => array
  152. (
  153. 'tcash' => array('yes', '+='),
  154. ),
  155. ),
  156. )
  157. );