rabin 3 years ago
parent
commit
3f3570b9e5
4 changed files with 108 additions and 2 deletions
  1. 2 2
      assets/layadmin/html/inc/nav.html
  2. 17 0
      database/admin.php
  3. 88 0
      database/company.php
  4. 1 0
      database/role.php

+ 2 - 2
assets/layadmin/html/inc/nav.html

@@ -41,9 +41,9 @@
 
 <ul class="layui-nav layui-layout-right" lay-filter="layadmin-layout-right">
 
-  <li class="layui-nav-item auth-top" lay-unselect style="display:none;">
+  <li class="layui-nav-item auth-top" lay-unselect>
     <a href="javascript:;">
-      <cite><span></span></cite>
+      <cite><span>222</span></cite>
     </a>
     <ul class="layui-nav-child">
       <li><a lay-href="set/user/info.html">基本资料</a></li>

+ 17 - 0
database/admin.php

@@ -16,6 +16,12 @@ $cur = Dever::load('manage/auth.data', false);
 # 获取top权限
 //$auth = Dever::tops();
 
+
+$company = function()
+{
+	$data = Dever::load('manage/company-state');
+	return $data;
+};
 $desc = '';
 if($cur && $cur['role'] > 1)
 {
@@ -601,6 +607,17 @@ return array
 			'update'	=> 'select',
 			//'list'		=> true,
 		),
+
+		'company'		=> array
+		(
+			'type' 		=> 'varchar-2000',
+			'name' 		=> '选择公司',
+			'default' 	=> '',
+			'desc' 		=> '选择公司',
+			'match' 	=> 'is_string',
+			'update'	=> 'checkbox',
+			'option'	=> $company,
+		),
 		
 		'role'		=> array
 		(

+ 88 - 0
database/company.php

@@ -0,0 +1,88 @@
+<?php
+
+# 常用的col
+$col = '*';
+return array
+(
+    # 表名
+    'name' => 'company',
+    # 显示给用户看的名称
+    'lang' => '公司管理',
+    'order' => 7,
+
+    # 数据结构
+    'struct' => array
+    (
+        'id'        => array
+        (
+            'type'      => 'int-11',
+            'name'      => 'ID',
+            'default'   => '',
+            'desc'      => '',
+            'match'     => 'is_numeric',
+            'list'      => true,
+        ),
+        
+        'name'      => array
+        (
+            'type'      => 'varchar-80',
+            'name'      => '公司名称',
+            'default'   => '',
+            'desc'      => '公司名称',
+            'match'     => 'is_string',
+            'update'    => 'text',
+            'list'      => true,
+            'search'    => 'fulltext',
+        ),
+        
+        '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,
+            'list'        => 'date("Y-m-d H:i", {cdate})',
+        ),
+    ),
+
+	'default' => array
+    (
+        'col' => 'id,name,state,cdate',
+        'value' => array
+        (
+            '1,"默认公司", 1,' . DEVER_TIME,
+        ),
+    ),
+    
+    # 管理功能
+    'manage' => array
+    (
+       'delete' => false,
+    ),
+
+    'request' => array
+    (
+        'getIds' => array
+        (
+            'type' => 'all',
+            'option' => array
+            (
+                'ids' => array('yes-id', 'in'),
+                'state' => 1,
+            ),
+            'order' => array('id' => 'desc'),
+            'col' => '*|id',
+        ),
+    ),
+);

+ 1 - 0
database/role.php

@@ -95,6 +95,7 @@ $role = function() use($cur)
 	return $array;
 };
 
+
 # 获取权限list 建议这里使用匿名函数
 $auth_data = function()
 {