dever 6 years ago
parent
commit
b43ad35efd
5 changed files with 33 additions and 8 deletions
  1. 2 2
      assets/moltran/html/inc/script.html
  2. 8 0
      database/admin.php
  3. 1 1
      database/menu.php
  4. 5 0
      src/Auth.php
  5. 17 5
      src/Database.php

+ 2 - 2
assets/moltran/html/inc/script.html

@@ -7,12 +7,12 @@
             <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
             <h3 id="dever_modal_title">消息提醒</h3>
         </div>
-        <div class="modal-body" id="dever_modal_body">
+        <div class="modal-body" id="dever_modal_body" style="overflow-x: hidden;overflow-y: auto;max-height: 400px;">
             
         </div>
         <div class="modal-footer">
             <button class="btn btn-default" id="dever_modal_no" data-dismiss="modal" aria-hidden="true">取消</button>
-            <button class="btn btn-danger" id="dever_modal_yes" data-dismiss="modal">确定</button>
+            <button class="btn btn-danger" id="dever_modal_yes">确定</button>
         </div>
       </div>
     </div>

+ 8 - 0
database/admin.php

@@ -318,6 +318,14 @@ return array
 			'js' => 'demo',
 			'css' => 'demo',
 		),
+
+		# 快捷更新
+		/*
+		'list_button' => array
+		(
+			'edit' => array('审核', 'name'),
+		),
+		*/
 	),
 	
 	# 更新表结构

+ 1 - 1
database/menu.php

@@ -50,7 +50,7 @@ return array
 		//'update' => 'manage/menu.checkKey',
 		//'insert' => 'manage/menu.checkKey',
 	),
-	'check' => 'key',
+	//'check' => 'key',
 	# 数据结构
 	'struct' => array
 	(

+ 5 - 0
src/Auth.php

@@ -485,6 +485,11 @@ class Auth
 
         $key = str_replace('/', '-', $key);
         $data = $this->save->get($this->name . '_topgetv1_' . $key . '_a' . $data['id']);
+
+        $top = Dever::input('top');
+        if ($top) {
+            $data = Dever::db('manage/top')->one($top);
+        }
         //print_r($data);die;
         # 当数据不存在时,先从数据库里取出一个最新的
         if (!$data && $state == true) {

+ 17 - 5
src/Database.php

@@ -70,6 +70,11 @@ class Database
         $this->menu = Dever::input('menu');
         $this->menu_id = Dever::input('menu_id');
         $this->id = Dever::input('update_where_id', Dever::input('where_id'));
+
+        $this->top = Dever::input('top');
+        if ($this->top) {
+            Dever::load('manage/top.update_action', $this->top);
+        }
     }
 
     /**
@@ -93,6 +98,8 @@ class Database
             'search'              => 'project/database/list?{param}',
             'add'               => 'project/database/update?{param}',
             'update'            => 'project/database/update?{param}&where_id=' . $id,
+            # 增加快捷更新
+            'edit'            => 'project/database/update?{param}&where_id=' . $id,
             'updateAction'      => 'database.update_action',
             'url'               => '',
             'delete'      => 'database.delete_action?{param}&where_id=' . $id,
@@ -111,6 +118,8 @@ class Database
             $config[$key] = $config['list'];
         } elseif (strpos($key, 'add') !== false) {
             $config[$key] = $config['add'];
+        } elseif (strpos($key, 'edit') !== false) {
+            $config[$key] = $config['edit'];
         }
 
         if (isset($config[$key])) {
@@ -525,11 +534,9 @@ class Database
             );
 
             if (!isset($config['manage']['edit']) && $config['update'] == true) {
-                # 3
                 $config['manage']['_list']['value']['update'] = '编辑';
             }
             if (!isset($config['manage']['delete']) || (isset($config['manage']['delete']) && $config['manage']['delete'] == true)) {
-                # 6
                 $config['manage']['_list']['value']['delete'] = '删除';
             }
             if (isset($config['manage']['list'][0]) && is_array($config['manage']['list'][0])) {
@@ -1792,10 +1799,11 @@ class Database
                         }
 
                         if ($oper == true) {
-                            if (strpos($kj, 'oper') !== false) {
+                            if (strpos($kj, 'edit') !== false) {
+                                $result[$k] .= '<a href="javascript:;" onclick="fastEdit($(this), \'' . $this->url($kj, $v['id']) . '\', \''.$vj[0].'\', \''.$vj[1].'\')"><button type="button" class="btn btn-info btn-rounded waves-effect waves-light m-b-5">' . $vj[0] . '</button></a>&nbsp;&nbsp;';
+                            } elseif (strpos($kj, 'oper') !== false) {
                                 $result[$k] .= '<a href="javascript:;" onclick="load(\'' . Dever::url($pj) . '\')"><button type="button" class="btn btn-info btn-rounded waves-effect waves-light m-b-5">' . $vj[0] . '</button></a>&nbsp;&nbsp;';
-                            }
-                            elseif (isset($vj[1]) && strpos($vj[1], 'modal|') !== false) {
+                            } elseif (isset($vj[1]) && strpos($vj[1], 'modal|') !== false) {
                                 $t = explode('|', $vj[1]);
                                 $result[$k] .= '<a href="#dever_modal" data-toggle="modal"  class="btn btn-info btn-rounded waves-effect waves-light m-b-5" onclick=' . $t[1] . ' msg-send="' . $this->value($t[2], $data[$k]) . '">' . $vj[0] . '</a>&nbsp;&nbsp;';
                             } elseif (isset($vj[1])) {
@@ -2010,8 +2018,12 @@ class Database
 
         //print_r($config['manage']['update']);die;
         $data = $this->getAdminInfo($data);
+        $col = Dever::input('col');
         foreach ($config['struct'] as $k => $v) {
             if (isset($v['update'])) {
+                if ($col && !strstr($col, $k)) {
+                    continue;
+                }
                 //处理权限
                 if (isset($v['auth'])) {
                     $auth = $this->value($v['auth'], $data);