member_agreement.php 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451
  1. <?php
  2. $status = array
  3. (
  4. 1 => array('name' => '待签署', 'style' => 'font-weight:bold;color:#436EEE'),
  5. 2 => array('name' => '有效', 'style' => 'font-weight:bold;color:green'),
  6. 3 => array('name' => '作废', 'style' => 'font-weight:bold;color:#CD3700'),
  7. );
  8. $mid = Dever::input('search_option_mid');
  9. $button = array();
  10. if ($mid) {
  11. $button = array
  12. (
  13. '返回上一页' => array('location', 'l=project/database/list&project=agent&table=member_area&page_type=1&mid=' . $mid),
  14. );
  15. }
  16. $list_button = array();
  17. $list_button['new'] = array('查看', '"lib/agreement.location?id={id}"', 'agent');
  18. if (Dever::load('manage/auth')->checkFunc('agent.member_agreement', 'edit', '作废并生成')) {
  19. $list_button['oper'] = array('作废并生成', '"agent/lib/manage.dropAgreement?id={id}"', "{status} == 2");
  20. }
  21. if (Dever::load('manage/auth')->checkFunc('agent.member_agreement', 'edit1', '更新')) {
  22. $list_button['oper1'] = array('更新', '"agent/lib/manage.upAgreement?id={id}"', "{status} <= 2");
  23. }
  24. return array
  25. (
  26. # 表名
  27. 'name' => 'member_agreement',
  28. # 显示给用户看的名称
  29. 'lang' => '合同管理',
  30. 'order' => 10,
  31. 'status' => $status,
  32. # 数据结构
  33. 'struct' => array
  34. (
  35. 'id' => array
  36. (
  37. 'type' => 'int-11',
  38. 'name' => 'ID',
  39. 'default' => '',
  40. 'desc' => '',
  41. 'match' => 'is_numeric',
  42. 'search' => 'order',
  43. //'list' => true,
  44. ),
  45. 'mid' => array
  46. (
  47. 'type' => 'int-11',
  48. 'name' => '代理商姓名/手机号',
  49. 'default' => '-1',
  50. 'desc' => '代理商',
  51. 'match' => 'is_string',
  52. 'update' => 'text',
  53. 'search' => array
  54. (
  55. 'api' => 'agent/member-getSearch',
  56. 'col' => 'col',
  57. 'result' => 'id',
  58. 'search' => 'mid',
  59. ),
  60. 'list_name' => '代理商信息',
  61. 'list' => 'Dever::load("agent/lib/member.getOne", {mid}, "agent/member", true)',
  62. 'list_order' => 3,
  63. ),
  64. 'agent-member-name'=> array
  65. (
  66. 'name' => '姓名',
  67. 'default' => '',
  68. 'desc' => '姓名',
  69. 'match' => 'option',
  70. # 读取另外表的关联方式
  71. 'sync' => array('mid', 'id'),
  72. //'list' => $mid ? false : true,
  73. //'list_order' => 1,
  74. ),
  75. 'agent-member-role'=> array
  76. (
  77. 'name' => '代理角色',
  78. 'default' => '',
  79. 'desc' => '代理角色',
  80. 'match' => 'option',
  81. # 读取另外表的关联方式
  82. 'sync' => array('mid', 'id'),
  83. //'list' => 'Dever::load("setting/role-find#name", "{agent-member-role}")',
  84. //'list_order' => 3,
  85. ),
  86. 'order_num' => array
  87. (
  88. 'type' => 'varchar-100',
  89. 'name' => '合同编号',
  90. 'default' => '',
  91. 'desc' => '合同编号',
  92. 'match' => 'is_string',
  93. 'update' => 'text',
  94. ),
  95. 'order_id' => array
  96. (
  97. 'type' => 'int-11',
  98. 'name' => '关联订单表id',
  99. 'default' => '',
  100. 'desc' => '关联订单表id',
  101. 'match' => 'is_numeric',
  102. ),
  103. 'agreement_id' => array
  104. (
  105. 'type' => 'int-11',
  106. 'name' => '合同模板id',
  107. 'default' => '',
  108. 'desc' => '合同模板id',
  109. 'match' => 'is_numeric',
  110. ),
  111. 'agreement_name' => array
  112. (
  113. 'type' => 'varchar-500',
  114. 'name' => '合同名称',
  115. 'default' => '',
  116. 'desc' => '合同名称',
  117. 'match' => 'is_string',
  118. 'update' => 'text',
  119. 'search' => 'fulltext',
  120. 'list' => true,
  121. 'list_order' => 6,
  122. ),
  123. 'type' => array
  124. (
  125. 'type' => 'tinyint-1',
  126. 'name' => '类型',
  127. 'default' => '1',
  128. 'desc' => '类型',
  129. 'match' => 'is_numeric',
  130. ),
  131. 'sign' => array
  132. (
  133. 'type' => 'varchar-150',
  134. 'name' => '合同签名',
  135. 'default' => '',
  136. 'desc' => '合同签名',
  137. 'match' => 'option',
  138. 'update' => 'image',
  139. 'key' => '7',
  140. 'list' => '"<img src=\'{sign}\' width=\'150\'>"',
  141. 'list_order' => 7,
  142. ),
  143. 'name' => array
  144. (
  145. 'type' => 'varchar-100',
  146. 'name' => '姓名',
  147. 'default' => '',
  148. 'desc' => '姓名',
  149. 'match' => 'is_string',
  150. 'update' => 'text',
  151. ),
  152. 'mobile' => array
  153. (
  154. 'type' => 'bigint-11',
  155. 'name' => '手机号',
  156. 'default' => '',
  157. 'desc' => '请输入手机号',
  158. 'match' => Dever::rule('mobile'),
  159. 'update' => 'text',
  160. //'search' => $mid ? 'hidden' : 'fulltext',
  161. //'list' => $mid ? false : true,
  162. //'list_order' => 2,
  163. ),
  164. 'role' => array
  165. (
  166. 'type' => 'int-11',
  167. 'name' => '代理角色',
  168. 'default' => '',
  169. 'desc' => '代理角色',
  170. 'match' => 'is_numeric',
  171. ),
  172. 'price' => array
  173. (
  174. 'type' => 'decimal-11,2',
  175. 'name' => '实付金额',
  176. 'default' => '0',
  177. 'desc' => '金额',
  178. 'match' => 'option',
  179. 'update' => 'text',
  180. ),
  181. 'area' => array
  182. (
  183. 'type' => 'varchar-500',
  184. 'name' => '区域',
  185. 'default' => '',
  186. 'desc' => '区域',
  187. 'match' => 'option',
  188. ),
  189. 'idcard' => array
  190. (
  191. 'type' => 'varchar-32',
  192. 'name' => '身份证号码',
  193. 'default' => '',
  194. 'desc' => '身份证号码',
  195. 'match' => 'is_string',
  196. 'update' => 'text',
  197. //'search' => 'fulltext',
  198. ),
  199. 'idcard_front' => array
  200. (
  201. 'type' => 'varchar-150',
  202. 'name' => '身份证正面',
  203. 'default' => '',
  204. 'desc' => '身份证正面',
  205. 'match' => 'option',
  206. 'update' => 'image',
  207. 'key' => '8',
  208. 'place' => '660*660',
  209. ),
  210. 'idcard_back' => array
  211. (
  212. 'type' => 'varchar-150',
  213. 'name' => '身份证背面',
  214. 'default' => '',
  215. 'desc' => '身份证背面',
  216. 'match' => 'option',
  217. 'update' => 'image',
  218. 'key' => '8',
  219. 'place' => '660*660',
  220. ),
  221. 'company_name' => array
  222. (
  223. 'type' => 'varchar-100',
  224. 'name' => '公司名称',
  225. 'default' => '',
  226. 'desc' => '公司名称',
  227. 'match' => 'is_string',
  228. 'update' => 'text',
  229. //'search' => 'fulltext',
  230. //'list' => true,
  231. ),
  232. 'company_pic' => array
  233. (
  234. 'type' => 'varchar-150',
  235. 'name' => '营业执照',
  236. 'default' => '',
  237. 'desc' => '营业执照',
  238. 'match' => 'option',
  239. 'update' => 'image',
  240. 'key' => '8',
  241. 'place' => '660*660',
  242. ),
  243. 'company_number' => array
  244. (
  245. 'type' => 'varchar-80',
  246. 'name' => '营业执照号码',
  247. 'default' => '',
  248. 'desc' => '营业执照号码',
  249. 'match' => 'is_string',
  250. 'update' => 'text',
  251. ),
  252. 'address' => array
  253. (
  254. 'type' => 'varchar-800',
  255. 'name' => '地址',
  256. 'default' => '',
  257. 'desc' => '地址',
  258. 'match' => 'is_string',
  259. 'update' => 'text',
  260. ),
  261. 'qdate' => array
  262. (
  263. 'type' => 'int-11',
  264. 'name' => '协议签订时间',
  265. 'match' => 'is_numeric',
  266. 'desc' => '协议签订时间',
  267. 'update' => 'text',
  268. ),
  269. 'sdate' => array
  270. (
  271. 'type' => 'int-11',
  272. 'name' => '有效期开始时间',
  273. 'match' => 'is_numeric',
  274. 'desc' => '有效期开始时间',
  275. 'update' => 'text',
  276. ),
  277. 'edate' => array
  278. (
  279. 'type' => 'int-11',
  280. 'name' => '有效期结束时间',
  281. 'match' => 'is_numeric',
  282. 'desc' => '有效期结束时间',
  283. 'update' => 'text',
  284. ),
  285. 'udate' => array
  286. (
  287. 'type' => 'int-11',
  288. 'name' => '更新时间',
  289. 'match' => 'is_numeric',
  290. 'desc' => '更新时间',
  291. 'search' => 'date',
  292. // 'list' => 'date("Y-m-d H:i", {udate})',
  293. 'list_name' => '创建时间<br/>更新时间',
  294. 'list' => 'Dever::load("agent/lib/agreement.data",{id})',
  295. 'list_order' => 5,
  296. ),
  297. 'content' => array
  298. (
  299. 'type' => 'text-255',
  300. 'name' => '合同内容',
  301. 'default' => '',
  302. 'desc' => '请输入内容',
  303. 'match' => 'is_string',
  304. ),
  305. 'status' => array
  306. (
  307. 'type' => 'tinyint-1',
  308. 'name' => '合同状态',
  309. 'default' => '1',
  310. 'desc' => '合同状态',
  311. 'match' => 'is_numeric',
  312. 'option' => $status,
  313. 'search' => 'select',
  314. 'list' => true,
  315. 'list_order' => 8,
  316. ),
  317. 'state' => array
  318. (
  319. 'type' => 'tinyint-1',
  320. 'name' => '状态',
  321. 'default' => '1',
  322. 'desc' => '请选择状态',
  323. 'match' => 'is_numeric',
  324. ),
  325. 'cdate' => array
  326. (
  327. 'type' => 'int-11',
  328. 'name' => '创建时间',
  329. 'match' => array('is_numeric', time()),
  330. 'desc' => '',
  331. # 只有insert时才生效
  332. 'insert' => true,
  333. //'search' => 'date',
  334. // 'list' => 'date("Y-m-d H:i", {cdate})',
  335. // 'list_order' => 4,
  336. ),
  337. ),
  338. 'alter' => array
  339. (
  340. 5 => array
  341. (
  342. array('update', 'price', 'price', 'decimal-11,2 0 实付金额'),
  343. ),
  344. 'version' => 5,
  345. ),
  346. 'manage' => array
  347. (
  348. 'list_table' => 'html',
  349. 'insert' => false,
  350. 'delete' => false,
  351. 'edit' => false,
  352. 'button' => $button,
  353. 'list_button' => $list_button,
  354. ),
  355. 'request' => array
  356. (
  357. 'getData' => array
  358. (
  359. # 匹配的正则或函数 选填项
  360. 'option' => array
  361. (
  362. 'mid' => 'yes',
  363. 'order_id' => 'yes',
  364. 'agreement_id' => 'yes',
  365. 'state' => 1,
  366. ),
  367. 'type' => 'all',
  368. 'order' => array('id' => 'desc'),
  369. 'col' => '*',
  370. ),
  371. 'getOld' => array
  372. (
  373. # 匹配的正则或函数 选填项
  374. 'option' => array
  375. (
  376. 'mid' => 'yes',
  377. 'order_id' => 'yes',
  378. 'agreement_id' => 'yes',
  379. 'state' => 1,
  380. ),
  381. 'type' => 'one',
  382. 'order' => array('id' => 'desc'),
  383. 'col' => '*',
  384. ),
  385. 'getOne' => array
  386. (
  387. # 匹配的正则或函数 选填项
  388. 'option' => array
  389. (
  390. 'mid' => 'yes',
  391. 'type' => 'yes',
  392. 'state' => 1,
  393. ),
  394. 'type' => 'one',
  395. 'order' => array('id' => 'desc'),
  396. 'col' => '*',
  397. ),
  398. 'getAll' => array
  399. (
  400. # 匹配的正则或函数 选填项
  401. 'option' => array
  402. (
  403. 'mid' => 'yes',
  404. 'state' => 1,
  405. ),
  406. 'type' => 'all',
  407. 'order' => array('id' => 'desc'),
  408. 'page' => array(10, 'list'),
  409. 'col' => 'id,mid,agreement_id,status,qdate,role,name,area,agreement_name',
  410. ),
  411. ),
  412. );