songxingwei 2 gadi atpakaļ
vecāks
revīzija
5920f52e98
1 mainītis faili ar 15 papildinājumiem un 2 dzēšanām
  1. 15 2
      application/admin/controller/Towns.php

+ 15 - 2
application/admin/controller/Towns.php

@@ -45,7 +45,8 @@ class Towns extends Controller
      */
     public function index()
     {
-        $this->title = '乡镇列表';
+        $this->title = '乡镇管理';
+        sysoplog('乡镇管理', '访问乡镇管理页面');
         $query = $this->_query($this->table)->like('name');
         $query->where('is_del',1)->order('id desc')->page();
     }
@@ -103,7 +104,18 @@ class Towns extends Controller
                 $this->error('乡镇已存在');
             }
         }
+    }
 
+    /**
+     * 处理成功回调
+     */
+    public function _form_result($result,$data){
+        $name = isset($data['id']) ? '编辑' : '新增';
+        if ($result) {
+            sysoplog('乡镇管理', $name.'成功'.json_encode($data,true));
+        }else{
+            sysoplog('乡镇管理', $name.'失败'.json_encode($data,true));
+        }
     }
 
     /**
@@ -115,7 +127,8 @@ class Towns extends Controller
      */
     public function del()
     {
-        $this->_save($this->table, ['is_del' => '0']);
+        $log = ['action'=>'权限管理','content'=>'删除'];
+        $this->_save($this->table, ['is_del' => '0'],$log);
     }