member_agreement.php 17 KB

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