rabin 3 rokov pred
rodič
commit
0fb086f2ee

+ 8 - 26
service/option/database/account.php

@@ -132,15 +132,6 @@ return array
             'default'   => '',
             'desc'      => '所属公司',
             'match'     => 'option',
-            'search'    => Dever::db('option/member')->config['company'] ? array
-            (
-                'api' => 'option/member-getOne',
-                'col' => 'company_id',
-                'result' => 'id',
-                'search' => 'mid',
-                'option'    => Dever::db('option/member')->config['company'],
-                'top'   => true,
-            ) : false,
             # 读取另外表的关联方式
             'sync'      => array('mid', 'id'),
         ),
@@ -438,15 +429,16 @@ return array
         ),
     ),
 
-    # 设置top权限
-    'top' => Dever::db('option/member')->config['top_set'],
-
-    # 增加这个,为了给当前的list增加一个option $admin = Dever::load('manage/auth.info');
-    'top_option' => array
+    'manage' => array
     (
-        array
+        'insert' => false,
+        'delete' => false,
+        'edit' => false,
+        'button' => $button,
+        'list_button' => $list_button,
+        'excel' => $excel,
+        'company' => array
         (
-            'value' => Dever::db('option/member')->config['auth'],
             'col' => 'company_id',
             'join' => array
             (
@@ -457,16 +449,6 @@ return array
         ),
     ),
 
-    'manage' => array
-    (
-        'insert' => false,
-        'delete' => false,
-        'edit' => false,
-        'button' => $button,
-        'list_button' => $list_button,
-        'excel' => $excel,
-    ),
-
     'request' => array
     (
         'list' => array

+ 1 - 17
service/option/database/agreement.php

@@ -29,7 +29,6 @@ if ($aid) {
     $option_aid = $aid;
     $search_auth = Dever::input('search_auth');
     if ($search_auth) {
-        Dever::config('base')->clear_top = 1;
         $option_aid .= '&search_auth=' . $search_auth;
     }
     $button = array
@@ -79,9 +78,6 @@ return array
             'default'   => '1',
             'desc'      => '所属公司',
             'match'     => 'is_numeric',
-            'update'    => 'select',
-            'option'    => Dever::db('option/member')->config['company'],
-            'search'    => Dever::db('option/member')->config['company'] ? 'select' : false,
             //'list'      => true,
         ),
 
@@ -388,19 +384,6 @@ return array
         ),
     ),
 
-    # 设置top权限
-    'top' => Dever::db('option/member')->config['top_set'],
-
-    # 增加这个,为了给当前的list增加一个option $admin = Dever::load('manage/auth.info');
-    'top_option' => array
-    (
-        array
-        (
-            'value' => Dever::db('option/member')->config['auth'],
-            'col' => 'company_id',
-        ),
-    ),
-
     'alter' => array
     (
         5 => array
@@ -427,6 +410,7 @@ return array
             //'oper1' => array('更新', '"option/lib/manage.upAgreement?id={id}"', "{status} == 2"),
             'edit' => array('审核', 'audit,audit_desc', '{audit} == 2'),
         ),
+        'company' => 'company_id',
     ),
 
     'request' => array

+ 10 - 28
service/option/database/bill_duifu.php

@@ -70,15 +70,6 @@ return array
             'default'   => '',
             'desc'      => '所属公司',
             'match'     => 'option',
-            'search'    => Dever::db('option/member')->config['company'] ? array
-            (
-                'api' => 'option/member-getOne',
-                'col' => 'company_id',
-                'result' => 'id',
-                'search' => 'mid',
-                'option'    => Dever::db('option/member')->config['company'],
-                'top'   => true,
-            ) : false,
             # 读取另外表的关联方式
             'sync'      => array('mid', 'id'),
         ),
@@ -266,25 +257,6 @@ return array
         ),
     ),
 
-    # 设置top权限
-    'top' => Dever::db('option/member')->config['top_set'],
-
-    # 增加这个,为了给当前的list增加一个option $admin = Dever::load('manage/auth.info');
-    'top_option' => array
-    (
-        array
-        (
-            'value' => Dever::db('option/member')->config['auth'],
-            'col' => 'company_id',
-            'join' => array
-            (
-                'table' => 'option/member',
-                'type' => 'left join',
-                'on' => array('mid', 'id'),
-            ),
-        ),
-    ),
-
     'alter' => array
     (
         5 => array
@@ -308,6 +280,16 @@ return array
             'edit' => array('作废', 'audit,audit_desc', '{audit} == 1'),
             //'delete' => array('删除', '', '{status} == 1'),
         ),
+        'company' => array
+        (
+            'col' => 'company_id',
+            'join' => array
+            (
+                'table' => 'option/member',
+                'type' => 'left join',
+                'on' => array('mid', 'id'),
+            ),
+        ),
     ),
 
     'request' => array

+ 1 - 19
service/option/database/bill_fafang.php

@@ -70,15 +70,6 @@ return array
             'default'   => '',
             'desc'      => '所属公司',
             'match'     => 'option',
-            'search'    => Dever::db('option/member')->config['company'] ? array
-            (
-                'api' => 'option/member-getOne',
-                'col' => 'company_id',
-                'result' => 'id',
-                'search' => 'mid',
-                'option'    => Dever::db('option/member')->config['company'],
-                'top'   => true,
-            ) : false,
             # 读取另外表的关联方式
             'sync'      => array('mid', 'id'),
         ),
@@ -290,17 +281,8 @@ return array
             'edit' => array('作废', 'audit,audit_desc', '{audit} == 1'),
             //'delete' => array('删除', '', '{status} == 1'),
         ),
-    ),
-
-        # 设置top权限
-    'top' => Dever::db('option/member')->config['top_set'],
-
-    # 增加这个,为了给当前的list增加一个option $admin = Dever::load('manage/auth.info');
-    'top_option' => array
-    (
-        array
+        'company' => array
         (
-            'value' => Dever::db('option/member')->config['auth'],
             'col' => 'company_id',
             'join' => array
             (

+ 10 - 28
service/option/database/bill_jiaofu.php

@@ -72,15 +72,6 @@ return array
             'default'   => '',
             'desc'      => '所属公司',
             'match'     => 'option',
-            'search'    => Dever::db('option/member')->config['company'] ? array
-            (
-                'api' => 'option/member-getOne',
-                'col' => 'company_id',
-                'result' => 'id',
-                'search' => 'mid',
-                'option'    => Dever::db('option/member')->config['company'],
-                'top'   => true,
-            ) : false,
             # 读取另外表的关联方式
             'sync'      => array('mid', 'id'),
         ),
@@ -299,25 +290,6 @@ return array
         'version' => 5,
     ),
 
-    # 设置top权限
-    'top' => Dever::db('option/member')->config['top_set'],
-
-    # 增加这个,为了给当前的list增加一个option $admin = Dever::load('manage/auth.info');
-    'top_option' => array
-    (
-        array
-        (
-            'value' => Dever::db('option/member')->config['auth'],
-            'col' => 'company_id',
-            'join' => array
-            (
-                'table' => 'option/member',
-                'type' => 'left join',
-                'on' => array('mid', 'id'),
-            ),
-        ),
-    ),
-
     'manage' => array
     (
         'insert' => false,
@@ -331,6 +303,16 @@ return array
             //'edit' => array('审核', 'audit,audit_desc', '{audit} == 2'),
             //'delete' => array('删除', '', '{status} == 1'),
         ),
+        'company' => array
+        (
+            'col' => 'company_id',
+            'join' => array
+            (
+                'table' => 'option/member',
+                'type' => 'left join',
+                'on' => array('mid', 'id'),
+            ),
+        ),
     ),
 
     'request' => array

+ 23 - 36
service/option/database/company.php

@@ -1,5 +1,14 @@
 <?php
-
+$company = function()
+{
+    $array = array();
+    $data = Dever::db('manage/company')->state();
+    if($data)
+    {
+        $array += $data;
+    }
+    return $array;
+};
 # 常用的col
 $col = '*';
 return array
@@ -7,19 +16,9 @@ return array
     # 表名
     'name' => 'company',
     # 显示给用户看的名称
-    'lang' => '期权公司管理',
+    'lang' => '期权公司配置',
     'order' => -100,
-    'end' => array
-	(
-		'insert' => array
-		(
-			'manage/top.sync',
-		),
-		'update' => array
-		(
-			'manage/top.sync',
-		),
-	),
+    'check' => 'company_id',
 
     # 数据结构
     'struct' => array
@@ -34,22 +33,24 @@ return array
             'list'      => true,
         ),
         
-        'name'      => array
+        'company_id'      => array
         (
-            'type'      => 'varchar-80',
-            'name'      => '公司名称',
+            'type'      => 'int-11',
+            'name'      => '选择公司',
             'default'   => '',
             'desc'      => '公司名称',
-            'match'     => 'is_string',
-            'update'    => 'text',
+            'match'     => 'is_numeric',
+            'update'    => 'radio',
+            'list_name' => '公司名称',
+            'option'    => $company,
             'list'      => true,
-            'search'    => 'fulltext',
+            'search'    => 'select',
         ),
 
         'agreement_name'      => array
         (
             'type'      => 'varchar-500',
-            'name'      => '合同名称-变量说明:{name}是代理商姓名,{role}代理商角色,{area}签署地区,{date}签署时间',
+            'name'      => '合同名称-变量说明:{name}是姓名,{date}签署时间',
             'default'   => '',
             'desc'      => '合同名称',
             'match'     => 'is_string',
@@ -114,26 +115,12 @@ return array
         ),
     ),
 
-    'top' => array
-	(
-		# 数据来源
-		'data' => 'find',
-		# 菜单名
-		'name' => '期权公司设置',
-		# 默认值
-		'value' => 1,
-		# 对应的字段值,设置这个之后,所有设置等于这个值的字段,都要遵循这个权限的控制
-		'key' => 'option/company_id',
-		# 本表中代表名称的字段
-		'col' => 'name',
-	),
-
 	'default' => array
     (
-        'col' => 'id,name,state,cdate',
+        'col' => 'id,company_id,agreement_name, state,cdate',
         'value' => array
         (
-            '1,"代理商", 1,' . DEVER_TIME,
+            '1, 1, "{name}期权交付合同.{date}.pdf", 1,' . DEVER_TIME,
         ),
     ),
     

+ 3 - 46
service/option/database/member.php

@@ -18,29 +18,6 @@ $idcard_bind = array
     2 => '身份证未绑定',
 );
 
-# 获取公司权限
-$top = 'option/company_id';
-$auth = Dever::tops($top);
-$company = array();
-if (!$auth || ($auth && strstr($auth, ','))) {
-    $company = function()
-    {
-        $array = array();
-        $auth = Dever::tops('option/company_id');
-        if ($auth) {
-            $info = Dever::db('option/company')->getIds(array('ids' => $auth));
-        } else {
-            $info = Dever::db('option/company')->state();
-        }
-        
-        if($info)
-        {
-            $array += $info;
-        }
-        return $array;
-    };
-}
-
 $search_auth = Dever::input('search_option_dever_auth', 1);
 
 $list_button = array();
@@ -66,9 +43,6 @@ return array
     'order' => 100,
     'menu' => false,
     'check' => 'key,mobile',
-    'company' => $company,
-    'auth' => $auth,
-    'top_set' => $top,
     'start' => array
     (
         'insert' => 'option/lib/manage.checkMember',
@@ -106,8 +80,7 @@ return array
             'default'   => '1',
             'desc'      => '所属公司',
             'match'     => 'is_numeric',
-            'update'    => 'select',
-            'option'    => $company,
+            'update'    => 'hidden',
             //'search'    => $company ? 'select' : false,
             //'list'      => true,
         ),
@@ -241,30 +214,14 @@ return array
         ),
     ),
 
-    # 设置top权限
-    //'top' => $top,
-
-    # 增加这个,为了给当前的list增加一个option $admin = Dever::load('manage/auth.info');
-    'top_option' => array
-    (
-        array
-        (
-            'value' => $auth,
-            'col' => 'company_id',
-        ),
-        array
-        (
-            'value' => Dever::load('manage/auth.authData'),
-            'col' => 'id',
-        ),
-    ),
-
     'manage' => array
     (
         'insert' => false,
         'delete' => false,
         'edit' => false,
         'list_button' => $list_button,
+        # 设置公司权限
+        'company' => 'company_id',
     ),
 
     'request' => array

+ 1 - 1
service/option/lib/Account.php

@@ -373,7 +373,7 @@ class Account
     {
         $result = array();
 
-        $company = Dever::db('option/company')->one($member['company_id']);
+        $company = Dever::db('manage/company')->one($member['company_id']);
         $result = array
         (
             'type' => 'info',

+ 2 - 2
service/option/lib/Member.php

@@ -15,7 +15,7 @@ class Member
         if ($account) {
             $string = $account['name'] . '<br />' . $account['mobile'] . '<br />' . $account['idcard'] . '<br />' . $account['key'];
 
-            $company = Dever::db('option/company')->find($account['company_id']);
+            $company = Dever::db('manage/company')->find($account['company_id']);
             if ($company) {
                 $string .= '<br />' . $company['name'];
             }
@@ -37,7 +37,7 @@ class Member
                 $table['head'] = array('公司', '序列号', '姓名', '手机号', '类型');
                 $table['body'] = array();
                 foreach ($data as $k => $v) {
-                    $company = Dever::db('option/company')->one($v['company_id']);
+                    $company = Dever::db('manage/company')->one($v['company_id']);
                     if ($v['main'] == 1) {
                         $main = '主账号';
                     } else {