agreement.php 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353
  1. <?php
  2. /*
  3. $status = array
  4. (
  5. 1 => '待签署',
  6. 2 => '有效',
  7. 3 => '作废',
  8. );
  9. */
  10. $status = array
  11. (
  12. 1 => '有效',
  13. 2 => '有效',
  14. 3 => '作废',
  15. );
  16. $aid = Dever::input('search_option_aid');
  17. $button = array();
  18. if ($aid) {
  19. $button = array
  20. (
  21. '返回上一页' => array('location', 'l=project/database/list&project=option&table=cash&page_type=1&aid=' . $aid),
  22. );
  23. }
  24. return array
  25. (
  26. # 表名
  27. 'name' => 'agreement',
  28. # 显示给用户看的名称
  29. 'lang' => '合同管理',
  30. 'order' => 10,
  31. 'menu' => false,
  32. 'status' => $status,
  33. # 数据结构
  34. 'struct' => array
  35. (
  36. 'id' => array
  37. (
  38. 'type' => 'int-11',
  39. 'name' => 'ID',
  40. 'default' => '',
  41. 'desc' => '',
  42. 'match' => 'is_numeric',
  43. 'search' => 'order',
  44. //'list' => true,
  45. ),
  46. 'aid' => array
  47. (
  48. 'type' => 'int-11',
  49. 'name' => '手机号',
  50. 'default' => '-1',
  51. 'desc' => '代理商',
  52. 'match' => 'is_string',
  53. 'update' => 'text',
  54. 'search' => array
  55. (
  56. 'api' => 'option/account-find',
  57. 'col' => 'mobile',
  58. 'result' => 'id',
  59. ),
  60. 'list_name' => '期权账户',
  61. 'list' => 'Dever::load("option/lib/account.getInfo", {aid})',
  62. 'list_order' => 3,
  63. ),
  64. 'order_num' => array
  65. (
  66. 'type' => 'varchar-100',
  67. 'name' => '合同编号',
  68. 'default' => '',
  69. 'desc' => '合同编号',
  70. 'match' => 'is_string',
  71. 'update' => 'text',
  72. ),
  73. 'agreement_id' => array
  74. (
  75. 'type' => 'int-11',
  76. 'name' => '合同模板id',
  77. 'default' => '',
  78. 'desc' => '合同模板id',
  79. 'match' => 'is_numeric',
  80. ),
  81. 'agreement_name' => array
  82. (
  83. 'type' => 'varchar-500',
  84. 'name' => '合同名称',
  85. 'default' => '',
  86. 'desc' => '合同名称',
  87. 'match' => 'is_string',
  88. 'update' => 'text',
  89. 'search' => 'fulltext',
  90. 'list' => true,
  91. 'list_order' => 6,
  92. ),
  93. 'jiaofu_id' => array
  94. (
  95. 'type' => 'varchar-100',
  96. 'name' => '交付的id',
  97. 'default' => '',
  98. 'desc' => '交付的id',
  99. 'match' => 'is_string',
  100. ),
  101. 'jiaofu_total' => array
  102. (
  103. 'type' => 'float-11,2',
  104. 'name' => '交付的总额',
  105. 'default' => '',
  106. 'desc' => '交付的总额',
  107. 'match' => 'is_numeric',
  108. ),
  109. 'sign' => array
  110. (
  111. 'type' => 'varchar-150',
  112. 'name' => '合同签名',
  113. 'default' => '',
  114. 'desc' => '合同签名',
  115. 'match' => 'option',
  116. 'update' => 'image',
  117. 'key' => '7',
  118. 'list' => '"<img src=\'{sign}\' width=\'150\'>"',
  119. 'list_order' => 7,
  120. ),
  121. 'name' => array
  122. (
  123. 'type' => 'varchar-100',
  124. 'name' => '姓名',
  125. 'default' => '',
  126. 'desc' => '姓名',
  127. 'match' => 'is_string',
  128. 'update' => 'text',
  129. ),
  130. 'mobile' => array
  131. (
  132. 'type' => 'bigint-11',
  133. 'name' => '手机号',
  134. 'default' => '',
  135. 'desc' => '请输入手机号',
  136. 'match' => Dever::rule('mobile'),
  137. 'update' => 'text',
  138. 'search' => $aid ? 'hidden' : 'fulltext',
  139. //'list' => $aid ? false : true,
  140. //'list_order' => 2,
  141. ),
  142. 'idcard' => array
  143. (
  144. 'type' => 'varchar-32',
  145. 'name' => '身份证号码',
  146. 'default' => '',
  147. 'desc' => '身份证号码',
  148. 'match' => 'is_string',
  149. 'update' => 'text',
  150. ),
  151. 'idcard_front' => array
  152. (
  153. 'type' => 'varchar-150',
  154. 'name' => '身份证正面',
  155. 'default' => '',
  156. 'desc' => '身份证正面',
  157. 'match' => 'option',
  158. 'update' => 'image',
  159. 'key' => '8',
  160. 'place' => '660*660',
  161. ),
  162. 'idcard_back' => array
  163. (
  164. 'type' => 'varchar-150',
  165. 'name' => '身份证背面',
  166. 'default' => '',
  167. 'desc' => '身份证背面',
  168. 'match' => 'option',
  169. 'update' => 'image',
  170. 'key' => '8',
  171. 'place' => '660*660',
  172. ),
  173. 'address' => array
  174. (
  175. 'type' => 'varchar-800',
  176. 'name' => '地址',
  177. 'default' => '',
  178. 'desc' => '地址',
  179. 'match' => 'is_string',
  180. 'update' => 'text',
  181. ),
  182. 'qdate' => array
  183. (
  184. 'type' => 'int-11',
  185. 'name' => '协议签订时间',
  186. 'match' => 'is_numeric',
  187. 'desc' => '协议签订时间',
  188. 'update' => 'text',
  189. ),
  190. 'sdate' => array
  191. (
  192. 'type' => 'int-11',
  193. 'name' => '有效期开始时间',
  194. 'match' => 'is_numeric',
  195. 'desc' => '有效期开始时间',
  196. 'update' => 'text',
  197. ),
  198. 'edate' => array
  199. (
  200. 'type' => 'int-11',
  201. 'name' => '有效期结束时间',
  202. 'match' => 'is_numeric',
  203. 'desc' => '有效期结束时间',
  204. 'update' => 'text',
  205. ),
  206. 'udate' => array
  207. (
  208. 'type' => 'int-11',
  209. 'name' => '更新时间',
  210. 'match' => 'is_numeric',
  211. 'desc' => '更新时间',
  212. 'search' => 'date',
  213. 'list' => 'date("Y-m-d H:i", {udate})',
  214. 'list_order' => 5,
  215. ),
  216. 'content' => array
  217. (
  218. 'type' => 'text-255',
  219. 'name' => '合同内容',
  220. 'default' => '',
  221. 'desc' => '请输入内容',
  222. 'match' => 'is_string',
  223. ),
  224. 'status' => array
  225. (
  226. 'type' => 'tinyint-1',
  227. 'name' => '合同状态',
  228. 'default' => '1',
  229. 'desc' => '合同状态',
  230. 'match' => 'is_numeric',
  231. 'option' => $status,
  232. 'search' => 'select',
  233. 'list' => true,
  234. 'list_order' => 8,
  235. ),
  236. 'state' => array
  237. (
  238. 'type' => 'tinyint-1',
  239. 'name' => '状态',
  240. 'default' => '1',
  241. 'desc' => '请选择状态',
  242. 'match' => 'is_numeric',
  243. ),
  244. 'cdate' => array
  245. (
  246. 'type' => 'int-11',
  247. 'name' => '创建时间',
  248. 'match' => array('is_numeric', time()),
  249. 'desc' => '',
  250. # 只有insert时才生效
  251. 'insert' => true,
  252. //'search' => 'date',
  253. 'list' => 'date("Y-m-d H:i", {cdate})',
  254. 'list_order' => 4,
  255. ),
  256. ),
  257. 'manage' => array
  258. (
  259. 'insert' => false,
  260. 'delete' => false,
  261. 'edit' => false,
  262. 'button' => $button,
  263. 'list_button' => array
  264. (
  265. 'new' => array('查看', '"lib/agreement.location?id={id}"', 'option'),
  266. 'oper' => array('作废并生成', '"option/lib/manage.dropAgreement?id={id}"', "{status} == 2"),
  267. 'oper1' => array('更新', '"option/lib/manage.upAgreement?id={id}"', "{status} == 2"),
  268. ),
  269. ),
  270. 'request' => array
  271. (
  272. 'getData' => array
  273. (
  274. # 匹配的正则或函数 选填项
  275. 'option' => array
  276. (
  277. 'aid' => 'yes',
  278. 'agreement_id' => 'yes',
  279. 'state' => 1,
  280. ),
  281. 'type' => 'all',
  282. 'order' => array('id' => 'desc'),
  283. 'col' => '*',
  284. ),
  285. 'getOld' => array
  286. (
  287. # 匹配的正则或函数 选填项
  288. 'option' => array
  289. (
  290. 'aid' => 'yes',
  291. 'agreement_id' => 'yes',
  292. 'state' => 1,
  293. ),
  294. 'type' => 'one',
  295. 'order' => array('id' => 'desc'),
  296. 'col' => '*',
  297. ),
  298. 'getOne' => array
  299. (
  300. # 匹配的正则或函数 选填项
  301. 'option' => array
  302. (
  303. 'aid' => 'yes',
  304. 'type' => 'yes',
  305. 'state' => 1,
  306. ),
  307. 'type' => 'one',
  308. 'order' => array('id' => 'desc'),
  309. 'col' => '*',
  310. ),
  311. 'getAll' => array
  312. (
  313. # 匹配的正则或函数 选填项
  314. 'option' => array
  315. (
  316. 'aid' => 'yes',
  317. 'state' => 1,
  318. ),
  319. 'type' => 'all',
  320. 'order' => array('id' => 'desc'),
  321. 'page' => array(10, 'list'),
  322. 'col' => 'id,aid,agreement_id,status,qdate,name,agreement_name',
  323. ),
  324. ),
  325. );