作者 张佳

@@ -6,6 +6,7 @@ use think\Db; @@ -6,6 +6,7 @@ use think\Db;
6 use think\Request; 6 use think\Request;
7 use util\MCurl; 7 use util\MCurl;
8 use think\Cookie; 8 use think\Cookie;
  9 +use think\cache;
9 use think\Session; 10 use think\Session;
10 use app\common\model\products\department as departmentModel; 11 use app\common\model\products\department as departmentModel;
11 header("Content-type: text/html; charset=utf-8"); 12 header("Content-type: text/html; charset=utf-8");
@@ -42,6 +43,10 @@ class Department extends BaseController @@ -42,6 +43,10 @@ class Department extends BaseController
42 if(!empty($data['result'])){ 43 if(!empty($data['result'])){
43 $where['departmentName']=['like', '%' . $data['result'] . '%']; 44 $where['departmentName']=['like', '%' . $data['result'] . '%'];
44 } 45 }
  46 + if(Cache::get('name') != 'admin'){
  47 + $where['mechanismId']= Cache::get('id');
  48 + }
  49 +
45 //$org_id = session('organization.org_id'); 50 //$org_id = session('organization.org_id');
46 $list= Db::table('sos_user_department')->alias('d')->join("sos_user_mechanism m", "m.id=d.mechanismId")->field('d.id,d.departmentName,d.createTime,mechanismName')->where($where)->limit($offset,$rows)->select()->toArray(); 51 $list= Db::table('sos_user_department')->alias('d')->join("sos_user_mechanism m", "m.id=d.mechanismId")->field('d.id,d.departmentName,d.createTime,mechanismName')->where($where)->limit($offset,$rows)->select()->toArray();
47 $total= Db::table('sos_user_department')->where($where)->count(); 52 $total= Db::table('sos_user_department')->where($where)->count();
@@ -95,7 +95,7 @@ class Role extends BaseController @@ -95,7 +95,7 @@ class Role extends BaseController
95 95
96 $user=Cache::get('name'); 96 $user=Cache::get('name');
97 $user_id=Cache::get('id'); 97 $user_id=Cache::get('id');
98 - 98 + $where = array();
99 if($user !='admin'){ 99 if($user !='admin'){
100 $where['id']=$user_id; 100 $where['id']=$user_id;
101 } 101 }
@@ -176,7 +176,7 @@ @@ -176,7 +176,7 @@
176 } 176 }
177 //操作框 177 //操作框
178 function formatOper(val, row, index) { 178 function formatOper(val, row, index) {
179 - return '<a href="javascript:void(0)" onclick="showUser(' + val + ')">编辑</a> <a href="javascript:void(0)" onclick="showUser(' + val + ')">查看</a>'; 179 + return '<a href="javascript:void(0)" onclick="showUser(' + val + ')">编辑</a> ';
180 180
181 } 181 }
182 182
@@ -343,7 +343,7 @@ @@ -343,7 +343,7 @@
343 title: '部门管理' 343 title: '部门管理'
344 } 344 }
345 }); 345 });
346 - $(id_MainIframe).attr('src','/web/Fu_ji_tong/index'); 346 + $(id_MainIframe).attr('src','/web/Department/index');
347 objMainTabs.tabs('selectById', 'AgentCarManage'); 347 objMainTabs.tabs('selectById', 'AgentCarManage');
348 }, 348 },
349 /** 349 /**