123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589 |
- <?php
- $status = array
- (
- 1 => array('name' => '待签署', 'style' => 'font-weight:bold;color:#436EEE'),
- 2 => array('name' => '有效', 'style' => 'font-weight:bold;color:green'),
- 3 => array('name' => '作废', 'style' => 'font-weight:bold;color:#CD3700'),
- 4 => array('name' => '终止合同', 'style' => 'font-weight:bold;color:#CD3700'),
- );
- $mid = Dever::input('search_option_mid');
- $button = array();
- if ($mid) {
- $button = array
- (
- '返回上一页' => array('location', 'l=project/database/list&project=agent&table=member_area&page_type=1&mid=' . $mid),
- );
- }
- $list_button = array();
- $list_button['new'] = array('查看', '"lib/agreement.location?id={id}"', 'agent');
- if (Dever::load('manage/auth')->checkFunc('agent.member_agreement', 'edit', '作废并生成')) {
- $list_button['oper'] = array('作废并生成', '"agent/lib/manage.dropAgreement?id={id}"', "{status} == 2");
- }
- if (Dever::load('manage/auth')->checkFunc('agent.member_agreement', 'edit1', '更新')) {
- $list_button['oper1'] = array('更新', '"agent/lib/manage.upAgreement?id={id}"', "{status} <= 2");
- }
- if (Dever::load('manage/auth')->checkFunc('agent.member_agreement', 'chongxinqianshu', '重新签署')) {
- $list_button['oper2'] = array('更新并重新签署', '"agent/lib/manage.upSignAgreement?id={id}"', "{status} == 2");
- }
- $agreement = function()
- {
- $array = array();
- $data = Dever::load('setting/lib/manage.getAgreementData');
- if($data)
- {
- $array += $data;
- }
- return $array;
- };
- $admin = Dever::load('manage/auth.info');
- $admin_auth = false;
- if ($admin && $admin['role'] == 24){
- $admin_auth = $admin['role'];
- }
- return array
- (
- # 表名
- 'name' => 'member_agreement',
- # 显示给用户看的名称
- 'lang' => '合同管理',
- 'order' => 10,
- 'status' => $status,
- # 数据结构
- 'struct' => array
- (
-
- 'id' => array
- (
- 'type' => 'int-11',
- 'name' => 'ID',
- 'default' => '',
- 'desc' => '',
- 'match' => 'is_numeric',
- 'search' => 'order',
- //'list' => true,
- ),
- 'mid' => array
- (
- 'type' => 'int-11',
- 'name' => '代理商姓名/手机号',
- 'default' => '-1',
- 'desc' => '代理商',
- 'match' => 'is_string',
- 'update' => 'text',
- 'search' => array
- (
- 'api' => 'agent/member-getSearch',
- 'col' => 'col',
- 'result' => 'id',
- 'search' => 'mid',
- ),
- 'list_name' => '代理商信息',
- 'list' => $admin_auth ? 'Dever::load("agent/lib/member.getOne", {mid}, "agent/member", true,true)' : 'Dever::load("agent/lib/member.getOne", {mid}, "agent/member", true)',
- 'list_order' => 3,
- ),
- 'agent-member-name'=> array
- (
- 'name' => '姓名',
- 'default' => '',
- 'desc' => '姓名',
- 'match' => 'option',
- # 读取另外表的关联方式
- 'sync' => array('mid', 'id'),
- //'list' => $mid ? false : true,
- //'list_order' => 1,
- ),
- 'agent-member-role'=> array
- (
- 'name' => '代理角色',
- 'default' => '',
- 'desc' => '代理角色',
- 'match' => 'option',
- # 读取另外表的关联方式
- 'sync' => array('mid', 'id'),
- //'list' => 'Dever::load("setting/role-find#name", "{agent-member-role}")',
- //'list_order' => 3,
- ),
- 'order_num' => array
- (
- 'type' => 'varchar-100',
- 'name' => '合同编号',
- 'default' => '',
- 'desc' => '合同编号',
- 'match' => 'is_string',
- 'update' => 'text',
- ),
- 'order_id' => array
- (
- 'type' => 'int-11',
- 'name' => '关联订单表id',
- 'default' => '',
- 'desc' => '关联订单表id',
- 'match' => 'is_numeric',
- ),
- 'agreement_id' => array
- (
- 'type' => 'int-11',
- 'name' => '合同模板',
- 'default' => '',
- 'desc' => '合同模板',
- 'match' => 'is_numeric',
- 'option' => $agreement,
- 'search' => 'select',
- ),
- 'agreement_name' => array
- (
- 'type' => 'varchar-500',
- 'name' => '合同名称',
- 'default' => '',
- 'desc' => '合同名称',
- 'match' => 'is_string',
- 'update' => 'text',
- 'search' => 'fulltext',
- 'list' => true,
- 'list_order' => 6,
- ),
- 'type' => array
- (
- 'type' => 'tinyint-1',
- 'name' => '类型',
- 'default' => '1',
- 'desc' => '类型',
- 'match' => 'is_numeric',
- ),
- 'sign' => array
- (
- 'type' => 'varchar-150',
- 'name' => '合同签名',
- 'default' => '',
- 'desc' => '合同签名',
- 'match' => 'option',
- 'update' => 'image',
- 'key' => '7',
- 'list' => '"<img src=\'{sign}\' width=\'150\'>"',
- 'list_order' => 7,
- ),
- 'sign_old' => array
- (
- 'type' => 'varchar-150',
- 'name' => '合同签名',
- 'default' => '',
- 'desc' => '合同签名',
- 'match' => 'option',
- //'update' => 'image',
- 'key' => '7',
- ),
- 'name' => array
- (
- 'type' => 'varchar-100',
- 'name' => '姓名',
- 'default' => '',
- 'desc' => '姓名',
- 'match' => 'is_string',
- 'update' => 'text',
- ),
- 'mobile' => array
- (
- 'type' => 'bigint-11',
- 'name' => '手机号',
- 'default' => '',
- 'desc' => '请输入手机号',
- 'match' => Dever::rule('mobile'),
- 'update' => 'text',
- //'search' => $mid ? 'hidden' : 'fulltext',
- //'list' => $mid ? false : true,
- //'list_order' => 2,
- ),
- 'role' => array
- (
- 'type' => 'int-11',
- 'name' => '代理角色',
- 'default' => '',
- 'desc' => '代理角色',
- 'match' => 'is_numeric',
- ),
- 'price' => array
- (
- 'type' => 'decimal-11,2',
- 'name' => '实付金额',
- 'default' => '0',
- 'desc' => '金额',
- 'match' => 'option',
- 'update' => 'text',
- ),
- 'area' => array
- (
- 'type' => 'varchar-500',
- 'name' => '区域',
- 'default' => '',
- 'desc' => '区域',
- 'match' => 'option',
- ),
- 'idcard' => array
- (
- 'type' => 'varchar-32',
- 'name' => '身份证号码',
- 'default' => '',
- 'desc' => '身份证号码',
- 'match' => 'is_string',
- 'update' => 'text',
- //'search' => 'fulltext',
- ),
- 'idcard_front' => array
- (
- 'type' => 'varchar-150',
- 'name' => '身份证正面',
- 'default' => '',
- 'desc' => '身份证正面',
- 'match' => 'option',
- 'update' => 'image',
- 'key' => '8',
- 'place' => '660*660',
- ),
- 'idcard_back' => array
- (
- 'type' => 'varchar-150',
- 'name' => '身份证背面',
- 'default' => '',
- 'desc' => '身份证背面',
- 'match' => 'option',
- 'update' => 'image',
- 'key' => '8',
- 'place' => '660*660',
- ),
- 'company_name' => array
- (
- 'type' => 'varchar-100',
- 'name' => '公司名称',
- 'default' => '',
- 'desc' => '公司名称',
- 'match' => 'is_string',
- 'update' => 'text',
- //'search' => 'fulltext',
- //'list' => true,
- ),
- 'company_pic' => array
- (
- 'type' => 'varchar-150',
- 'name' => '营业执照',
- 'default' => '',
- 'desc' => '营业执照',
- 'match' => 'option',
- 'update' => 'image',
- 'key' => '8',
- 'place' => '660*660',
- ),
- 'company_number' => array
- (
- 'type' => 'varchar-80',
- 'name' => '营业执照号码',
- 'default' => '',
- 'desc' => '营业执照号码',
- 'match' => 'is_string',
- 'update' => 'text',
- ),
- 'address' => array
- (
- 'type' => 'varchar-800',
- 'name' => '地址',
- 'default' => '',
- 'desc' => '地址',
- 'match' => 'is_string',
- 'update' => 'text',
- ),
- 'qdate' => array
- (
- 'type' => 'int-11',
- 'name' => '协议签订时间',
- 'match' => 'is_numeric',
- 'desc' => '协议签订时间',
- 'search' => 'date',
- 'update' => 'text',
- ),
- 'sdate' => array
- (
- 'type' => 'int-11',
- 'name' => '有效期开始时间',
- 'match' => 'is_numeric',
- 'desc' => '有效期开始时间',
- 'update' => 'text',
- ),
- 'edate' => array
- (
- 'type' => 'int-11',
- 'name' => '有效期结束时间',
- 'match' => 'is_numeric',
- 'desc' => '有效期结束时间',
- 'update' => 'text',
- ),
- 'udate' => array
- (
- 'type' => 'int-11',
- 'name' => '更新时间',
- 'match' => 'is_numeric',
- 'desc' => '更新时间',
- 'search' => 'date',
- // 'list' => 'date("Y-m-d H:i", {udate})',
- 'list_name' => '创建时间<br/>更新时间<br/>签署时间',
- 'list' => 'Dever::load("agent/lib/agreement.data",{id})',
- 'list_order' => 5,
- ),
- 'content' => array
- (
- 'type' => 'text-255',
- 'name' => '合同内容',
- 'default' => '',
- 'desc' => '请输入内容',
- 'match' => 'is_string',
- ),
- 'status' => array
- (
- 'type' => 'tinyint-1',
- 'name' => '合同状态',
- 'default' => '1',
- 'desc' => '合同状态',
- 'match' => 'is_numeric',
- 'option' => $status,
- 'search' => 'select',
- 'list' => true,
- 'list_order' => 8,
- ),
- 'state' => array
- (
- 'type' => 'tinyint-1',
- 'name' => '状态',
- 'default' => '1',
- 'desc' => '请选择状态',
- 'match' => 'is_numeric',
- ),
-
- 'cdate' => array
- (
- 'type' => 'int-11',
- 'name' => '创建时间',
- 'match' => array('is_numeric', time()),
- 'desc' => '',
- # 只有insert时才生效
- 'insert' => true,
- //'search' => 'date',
- // 'list' => 'date("Y-m-d H:i", {cdate})',
- // 'list_order' => 4,
- ),
- ),
- 'alter' => array
- (
- 5 => array
- (
- array('update', 'price', 'price', 'decimal-11,2 0 实付金额'),
- ),
- 'version' => 5,
- ),
- 'manage' => array
- (
- 'list_table' => 'html',
- 'insert' => false,
- 'delete' => false,
- 'edit' => false,
- 'button' => $button,
- 'list_button' => $list_button,
-
- ),
- 'request' => array
- (
- 'getData' => array
- (
- # 匹配的正则或函数 选填项
- 'option' => array
- (
- 'mid' => 'yes',
- 'order_id' => 'yes',
- 'agreement_id' => 'yes',
- 'state' => 1,
- ),
- 'type' => 'all',
- 'order' => array('id' => 'desc'),
- 'col' => '*',
- ),
- 'getOld' => array
- (
- # 匹配的正则或函数 选填项
- 'option' => array
- (
- 'mid' => 'yes',
- 'order_id' => 'yes',
- 'agreement_id' => 'yes',
- 'state' => 1,
- ),
- 'type' => 'one',
- 'order' => array('id' => 'desc'),
- 'col' => '*',
- ),
- 'getOlds' => array
- (
- # 匹配的正则或函数 选填项
- 'option' => array
- (
- 'mid' => 'yes',
- 'order_id' => 'yes',
- 'agreement_id' => 'yes',
- 'state' => 1,
- ),
- 'type' => 'all',
- 'order' => array('id' => 'desc'),
- 'col' => '*',
- ),
- 'getOne' => array
- (
- # 匹配的正则或函数 选填项
- 'option' => array
- (
- 'mid' => 'yes',
- 'type' => 'yes',
- 'state' => 1,
- ),
- 'type' => 'one',
- 'order' => array('id' => 'desc'),
- 'col' => '*',
- ),
- 'getAll' => array
- (
- # 匹配的正则或函数 选填项
- 'option' => array
- (
- 'mid' => 'yes',
- 'status' => array('yes', 'in'),
- 'state' => 1,
- ),
- 'type' => 'all',
- 'order' => array('id' => 'desc'),
- 'page' => array(10, 'list'),
- 'col' => 'id,mid,agreement_id,status,qdate,role,name,area,agreement_name',
- ),
- 'getNum' => array
- (
- # 匹配的正则或函数 选填项
- 'option' => array
- (
- 'fstart' => array('yes-qdate', '>='),
- 'fend' => array('yes-qdate', '<='),
- 'agreement_id' => 6,
- 'status' => array('yes','='),
- 'state' => 1,
- ),
- 'type' => 'count',
- 'col' => '*',
- ),
- 'getNoNum' => array
- (
- # 匹配的正则或函数 选填项
- 'option' => array
- (
- 'fstart' => array('yes-cdate', '>='),
- 'fend' => array('yes-cdate', '<='),
- 'status' => 'yes',
- 'agreement_id' => 6,
- 'state' => 1,
- ),
- 'type' => 'count',
- 'col' => '*',
- ),
- 'getPrice' => array
- (
- # 匹配的正则或函数 选填项
- 'option' => array
- (
- 'fstart' => array('yes-qdate', '>='),
- 'fend' => array('yes-qdate', '<='),
- 'status' => array('yes', '='),
- 'agreement_id' => 6,
- 'state' => 1,
- ),
- 'type' => 'one',
- 'col' => 'sum(price) as total',
- ),
- 'getNoPrice' => array
- (
- # 匹配的正则或函数 选填项
- 'option' => array
- (
- 'fstart' => array('yes-qdate', '>='),
- 'fend' => array('yes-qdate', '<='),
- 'status' => 'yes',
- 'agreement_id' => 6,
- 'state' => 1,
- ),
- 'type' => 'one',
- 'col' => 'sum(price) as total',
- ),
- 'getDataByNew' => array
- (
- # 匹配的正则或函数 选填项
- 'option' => array
- (
- 'id' => 'yes',
- 'ids' => array('yes-id', '<'),
- 'sign' => array('yes', 'like'),
- 'state' => 1,
- ),
- 'order' => array('id' => 'asc'),
- 'type' => 'all',
- //'limit' => '0,2',
- 'col' => 'id,mid,sign',
- ),
- 'getAlls' => array
- (
- # 匹配的正则或函数 选填项
- 'option' => array
- (
- 'agreement_id' => 'yes',
- 'mid' => 'yes',
- 'state' => 1,
- ),
- 'type' => 'all',
- 'order' => array('id' => 'desc'),
- 'col' => 'id',
- ),
- ),
- );
|