소스 검색

pc权限,管理员,管理组

lizhen_gitee 8 달 전
부모
커밋
15a8a6aa3f
2개의 변경된 파일100개의 추가작업 그리고 14개의 파일을 삭제
  1. 80 0
      application/company/controller/Tiaoshiweixiulogo.php
  2. 20 14
      application/company/controller/auth/Admin.php

+ 80 - 0
application/company/controller/Tiaoshiweixiulogo.php

@@ -0,0 +1,80 @@
+<?php
+
+namespace app\company\controller;
+
+use app\common\controller\Apic;
+use think\Db;
+/**
+ * 调试维修logo
+ */
+class Tiaoshiweixiulogo extends Apic
+{
+    protected $noNeedLogin = [];
+    protected $noNeedRight = [];
+
+    protected $table = 'tiaoshiweixiu_logo';
+   
+    public function index(){
+        $list = Db::name($this->table)->where('company_id',$this->auth->company_id)->select();
+        $list = list_domain_image($list,['image']);
+
+        $this->success(1,$list);
+    }
+
+    public function add(){
+        $data = [
+            'title' => input('title',''),
+            'image' => input('image',''),
+            'company_id' => $this->auth->company_id,
+            'updatetime' => time(),
+        ];
+
+        Db::name($this->table)->insertGetId($data);
+
+        $this->success();
+    }
+
+    public function info(){
+        $id = input('id',0);
+        $info = Db::name($this->table)->where('id',$id)->where('company_id',$this->auth->company_id)->find();
+        $info = info_domain_image($info,['image']);
+
+        $this->success(1,$info);
+    }
+
+    public function edit(){
+        $id = input('id',0);
+        $info = Db::name($this->table)->where('id',$id)->where('company_id',$this->auth->company_id)->find();
+        if(empty($info)){
+            $this->error('没找到该信息,请刷新重试');
+        }
+
+        $data = [
+            'title' => input('title',''),
+            'image' => input('image',''),
+            'updatetime' => time(),
+        ];
+
+        Db::name($this->table)->where('id',$id)->update($data);
+
+        $this->success();
+    }
+
+    public function del(){
+        $ids = input('ids','');
+        $ids = explode(',',$ids);
+
+        if (empty($ids)) {
+            $this->error();
+        }
+
+        Db::name($this->table)->where('id','IN',$ids)->where('company_id',$this->auth->company_id)->delete();
+        $this->success();
+    }
+
+
+
+
+
+
+}

+ 20 - 14
application/company/controller/auth/Admin.php

@@ -160,11 +160,8 @@ class Admin extends Apic
 
     }
 
-    /**
-     * 编辑
-     */
-    public function edit($ids = null)
-    {
+    public function info(){
+        $ids = input('id',0);
         $row = $this->model->get(['id' => $ids]);
         if (!$row) {
             $this->error(__('No Results were found'));
@@ -172,6 +169,22 @@ class Admin extends Apic
         if (!in_array($row->id, $this->childrenAdminIds)) {
             $this->error(__('You have no permission'));
         }
+        $grouplist = $this->auth->getGroups($row['id']);
+        $groupids = [];
+        foreach ($grouplist as $k => $v) {
+            $groupids = $v['id'];
+        }
+
+        $row['groupids'] = $groupids;
+        $this->success(1,$row);
+    }
+
+    /**
+     * 编辑
+     */
+    public function edit()
+    {
+        $ids = input('id',0);
         if ($this->request->isPost()) {
             $this->token();
             $params = $this->request->post("row/a");
@@ -225,14 +238,7 @@ class Admin extends Apic
             }
             $this->error(__('Parameter %s can not be empty', ''));
         }
-        $grouplist = $this->auth->getGroups($row['id']);
-        $groupids = [];
-        foreach ($grouplist as $k => $v) {
-            $groupids[] = $v['id'];
-        }
-        $this->view->assign("row", $row);
-        $this->view->assign("groupids", $groupids);
-        return $this->view->fetch();
+
     }
 
     /**
@@ -275,7 +281,7 @@ class Admin extends Apic
         $this->error(__('You have no permission'));
     }
 
-   
+
 
     /**
      * 下拉搜索