member_agreement.php 16 KB

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