invoice.php 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253
  1. <?php
  2. $type = array
  3. (
  4. 1 => '普通发票',
  5. 2 => '默认发票',
  6. );
  7. $title_type = array
  8. (
  9. 1 => '企业单位',
  10. 2 => '个人/非企业',
  11. );
  12. $source_table = Dever::input('search_option_source_table');
  13. $source_id = Dever::input('search_option_source_id');
  14. return array
  15. (
  16. # 表名
  17. 'name' => 'invoice',
  18. # 显示给用户看的名称
  19. 'lang' => '用户发票库',
  20. 'menu' => false,
  21. 'title_type' => $title_type,
  22. # 数据结构
  23. 'struct' => array
  24. (
  25. 'id' => array
  26. (
  27. 'type' => 'int-11',
  28. 'name' => 'ID',
  29. 'default' => '',
  30. 'desc' => '',
  31. 'match' => 'is_numeric',
  32. 'search' => 'order',
  33. 'update' => 'hidden',
  34. //'list' => true,
  35. ),
  36. 'source_table' => array
  37. (
  38. 'type' => 'varchar-100',
  39. 'name' => '来源表名',
  40. 'default' => '',
  41. 'desc' => '来源表名',
  42. 'match' => 'is_numeric',
  43. 'update' => 'hidden',
  44. 'value' => $source_table,
  45. ),
  46. 'source_id' => array
  47. (
  48. 'type' => 'int-11',
  49. 'name' => '用户名',
  50. 'default' => '0',
  51. 'desc' => '请选择用户',
  52. 'match' => 'is_numeric',
  53. 'update' => 'hidden',
  54. 'search' => $source_table ? array
  55. (
  56. 'api' => $source_table . '-like',
  57. 'col' => 'search',
  58. 'result' => 'id',
  59. ) : false,
  60. 'value' => $source_id,
  61. 'list' => 'Dever::load("user/lib/invoice.getSource#name", "{source_table}", "{source_id}")',
  62. ),
  63. 'type' => array
  64. (
  65. 'type' => 'tinyint-1',
  66. 'name' => '类型',
  67. 'default' => '2',
  68. 'desc' => '类型',
  69. 'match' => 'is_numeric',
  70. 'option' => $type,
  71. 'update' => 'hidden',
  72. 'value' => Dever::input('type', 2),
  73. 'list' => true,
  74. ),
  75. 'title_type' => array
  76. (
  77. 'type' => 'tinyint-1',
  78. 'name' => '抬头类型',
  79. 'default' => '1',
  80. 'desc' => '抬头类型',
  81. 'match' => 'is_numeric',
  82. 'option' => $title_type,
  83. 'update' => 'radio',
  84. 'list' => true,
  85. 'control' => 'title_type',
  86. ),
  87. 'title' => array
  88. (
  89. 'type' => 'varchar-150',
  90. 'name' => '抬头名称-企业单位为公司名称',
  91. 'default' => '',
  92. 'desc' => '抬头名称',
  93. 'match' => 'option',
  94. 'search' => 'fulltext',
  95. 'update' => 'text',
  96. 'list' => true,
  97. ),
  98. 'email' => array
  99. (
  100. 'type' => 'varchar-150',
  101. 'name' => '电子邮箱',
  102. 'default' => '',
  103. 'desc' => '电子邮箱',
  104. 'match' => 'option',
  105. 'search' => 'fulltext',
  106. 'update' => 'text',
  107. 'list' => true,
  108. ),
  109. 'mobile' => array
  110. (
  111. 'type' => 'varchar-150',
  112. 'name' => '手机号',
  113. 'default' => '',
  114. 'desc' => '手机号',
  115. 'match' => 'option',
  116. 'search' => 'fulltext',
  117. 'update' => 'text',
  118. 'list' => true,
  119. ),
  120. 'number' => array
  121. (
  122. 'type' => 'varchar-150',
  123. 'name' => '公司税号',
  124. 'default' => '',
  125. 'desc' => '公司税号',
  126. 'match' => 'option',
  127. 'update' => 'text',
  128. 'show' => 1,
  129. ),
  130. 'phone' => array
  131. (
  132. 'type' => 'varchar-100',
  133. 'name' => '公司电话',
  134. 'default' => '',
  135. 'desc' => '公司电话',
  136. 'match' => 'option',
  137. 'update' => 'text',
  138. 'show' => 1,
  139. ),
  140. 'address' => array
  141. (
  142. 'type' => 'varchar-1000',
  143. 'name' => '注册地址',
  144. 'default' => '',
  145. 'desc' => '注册地址',
  146. 'match' => 'option',
  147. 'update' => 'text',
  148. 'show' => 1,
  149. ),
  150. 'bank' => array
  151. (
  152. 'type' => 'varchar-100',
  153. 'name' => '开户银行',
  154. 'default' => '',
  155. 'desc' => '开户银行',
  156. 'match' => 'option',
  157. 'update' => 'text',
  158. 'show' => 1,
  159. ),
  160. 'bank_number' => array
  161. (
  162. 'type' => 'varchar-100',
  163. 'name' => '银行账号',
  164. 'default' => '',
  165. 'desc' => '银行账号',
  166. 'match' => 'option',
  167. 'update' => 'text',
  168. 'show' => 1,
  169. ),
  170. 'state' => array
  171. (
  172. 'type' => 'tinyint-1',
  173. 'name' => '状态',
  174. 'default' => '1',
  175. 'desc' => '请选择状态',
  176. 'match' => 'is_numeric',
  177. ),
  178. 'cdate' => array
  179. (
  180. 'type' => 'int-11',
  181. 'name' => '录入时间',
  182. 'match' => array('is_numeric', time()),
  183. 'desc' => '',
  184. # 只有insert时才生效
  185. 'insert' => true,
  186. 'search' => 'date',
  187. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  188. ),
  189. ),
  190. 'index' => array
  191. (
  192. 1 => array
  193. (
  194. 'source' => 'source_table,source_id,type',
  195. ),
  196. # 版本号 更改版本号会更新当前表的索引
  197. 'version' => 1,
  198. ),
  199. 'manage' => array
  200. (
  201. ),
  202. 'request' => array
  203. (
  204. 'getList' => array
  205. (
  206. # 匹配的正则或函数 选填项
  207. 'option' => array
  208. (
  209. 'uid' => 'yes',
  210. 'state' => 1,
  211. ),
  212. 'type' => 'all',
  213. 'order' => array('type' => 'desc','id' => 'desc'),
  214. 'page' => array(10, 'list'),
  215. 'col' => '*',
  216. ),
  217. 'updateType' => array
  218. (
  219. 'set' => array
  220. (
  221. 'type' => 'yes',
  222. ),
  223. 'where' => array
  224. (
  225. 'type' => 'yes',
  226. ),
  227. 'type' => 'update',
  228. ),
  229. ),
  230. );