|
@@ -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();
|