config_type.php 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  1. <?php
  2. $project = function()
  3. {
  4. $array = array
  5. (
  6. -1 => '全部项目',
  7. );
  8. $data = Dever::load('account/config_project-state');
  9. if($data)
  10. {
  11. $array += $data;
  12. }
  13. return $array;
  14. };
  15. $type = array
  16. (
  17. 1 => '增加',
  18. 2 => '减少',
  19. );
  20. $manual = array
  21. (
  22. 1 => '手动操作',
  23. 2 => '不可以手动操作',
  24. );
  25. $id = Dever::input('where_id');
  26. return array
  27. (
  28. # 表名
  29. 'name' => 'config_type',
  30. # 显示给用户看的名称
  31. 'lang' => '交易类型',
  32. # 是否显示在后台菜单
  33. 'order' => 10,
  34. 'check' => 'key',
  35. 'menu' => false,
  36. # 数据结构
  37. 'struct' => array
  38. (
  39. 'id' => array
  40. (
  41. 'type' => 'int-11',
  42. 'name' => 'ID',
  43. 'default' => '',
  44. 'desc' => '',
  45. 'match' => 'is_numeric',
  46. 'list' => true,
  47. 'order' => 'asc',
  48. ),
  49. 'name' => array
  50. (
  51. 'type' => 'varchar-150',
  52. 'name' => '交易类型名称',
  53. 'default' => '',
  54. 'desc' => '交易类型名称',
  55. 'match' => 'is_string',
  56. 'update' => 'text',
  57. 'search' => 'fulltext',
  58. 'list' => true,
  59. 'edit' => true,
  60. ),
  61. 'key' => array
  62. (
  63. 'type' => 'varchar-50',
  64. 'name' => '唯一标识-入账和出账通过该标识定义,充值和提现不能修改',
  65. 'default' => '',
  66. 'desc' => '唯一标识',
  67. 'match' => 'is_string',
  68. 'update' => ($id && $id < 12) ? false : 'text',
  69. 'search' => 'fulltext',
  70. 'list' => true,
  71. ),
  72. 'project_id' => array
  73. (
  74. 'type' => 'int-11',
  75. 'name' => '所属项目',
  76. 'default' => '-1',
  77. 'desc' => '所属项目',
  78. 'match' => 'is_numeric',
  79. 'update' => 'radio',
  80. 'option' => $project,
  81. 'list' => true,
  82. ),
  83. 'type' => array
  84. (
  85. 'type' => 'tinyint-1',
  86. 'name' => '交易模式',
  87. 'default' => '1',
  88. 'desc' => '交易模式',
  89. 'match' => 'is_numeric',
  90. 'update' => 'radio',
  91. 'option' => $type,
  92. 'list' => true,
  93. ),
  94. 'manual' => array
  95. (
  96. 'type' => 'tinyint-1',
  97. 'name' => '是否允许手动操作',
  98. 'default' => '1',
  99. 'desc' => '是否允许手动操作',
  100. 'match' => 'is_numeric',
  101. 'update' => 'radio',
  102. 'option' => $manual,
  103. 'list' => true,
  104. ),
  105. 'reorder' => array
  106. (
  107. 'type' => 'int-11',
  108. 'name' => '排序(数值越大越靠前)',
  109. 'default' => '1',
  110. 'desc' => '请输入排序',
  111. 'match' => 'option',
  112. //'update' => 'text',
  113. 'search' => 'order',
  114. 'list_name' => '排序',
  115. 'list' => true,
  116. 'order' => 'desc',
  117. 'edit' => true,
  118. ),
  119. 'state' => array
  120. (
  121. 'type' => 'tinyint-1',
  122. 'name' => '状态',
  123. 'default' => '1',
  124. 'desc' => '请选择状态',
  125. 'match' => 'is_numeric',
  126. ),
  127. 'cdate' => array
  128. (
  129. 'type' => 'int-11',
  130. 'name' => '录入时间',
  131. 'match' => array('is_numeric', time()),
  132. 'desc' => '',
  133. # 只有insert时才生效
  134. 'insert' => true,
  135. //'search' => 'date',
  136. //'list' => 'date("Y-m-d H:i:s", {cdate})',
  137. ),
  138. ),
  139. 'manage' => array
  140. (
  141. 'insert' => false,
  142. 'edit' => false,
  143. # 自定义快捷新增和编辑
  144. 'button' => array
  145. (
  146. '新增' => array('fast'),
  147. ),
  148. 'list_button' => array
  149. (
  150. 'edit' => array('编辑'),
  151. )
  152. ),
  153. 'default' => array
  154. (
  155. 'col' => 'id,name,`key`,project_id,type,manual,state,cdate',
  156. 'value' => array
  157. (
  158. '1,"充值", "chongzhi", -1, 1, 1, 1,' . DEVER_TIME,
  159. '2,"提现", "tixian",-1, 2, 1, 1,' . DEVER_TIME,
  160. '3,"采购", "caigou",-1, 2, 2, 1,' . DEVER_TIME,
  161. '4,"购买", "goumai",-1, 2, 2, 1,' . DEVER_TIME,
  162. '5,"销售", "xiaoshou",-1, 1, 2, 1,' . DEVER_TIME,
  163. '6,"收益", "shouyi",-1, 1, 2, 1,' . DEVER_TIME,
  164. '7,"提现作废", "tixian_zuofei",-1, 1, 2, 1,' . DEVER_TIME,
  165. '8,"购买退款", "goumai_tuikuan",-1, 1, 2, 1,' . DEVER_TIME,
  166. '9,"采购退款", "caigou_tuikuan",-1, 1, 2, 1,' . DEVER_TIME,
  167. '10,"销售退款", "xiaoshou_tuikuan",-1, 2, 2, 1,' . DEVER_TIME,
  168. '11,"收益退款", "shouyi_tuikuan",-1, 2, 2, 1,' . DEVER_TIME,
  169. ),
  170. ),
  171. 'request' => array
  172. (
  173. 'getData' => array
  174. (
  175. 'type' => 'all',
  176. 'option' => array
  177. (
  178. 'type' => 'yes',
  179. 'manual' => 'yes',
  180. 'project_id' => array('yes', 'in'),
  181. 'state' => 1,
  182. ),
  183. 'col' => '*|id',
  184. ),
  185. )
  186. );