diff --git a/app/api/controller/HomeIndex.php b/app/api/controller/HomeIndex.php index 6df9db2..b84d52b 100644 --- a/app/api/controller/HomeIndex.php +++ b/app/api/controller/HomeIndex.php @@ -20,7 +20,6 @@ use think\facade\View; class HomeIndex extends ApiController { - protected $middleware = [ Auth::class => ['except' => []] ]; diff --git a/app/api/controller/OaApprove.php b/app/api/controller/OaApprove.php new file mode 100644 index 0000000..89a7072 --- /dev/null +++ b/app/api/controller/OaApprove.php @@ -0,0 +1,41 @@ + ['except' => []] + ]; + + public function index() + { + $uid = JWT_UID; + $userInfo = Db::name('Admin')->where(['id' => $uid])->field(['id', 'username', 'name', 'email', 'mobile', 'sex', 'nickname', 'thumb', 'did', 'position_id', 'desc', 'entry_time'])->find(); + $department = $userInfo['did']; + $map1 = []; + $map2 = []; + $map1[] = ['status', '=', 1]; + $map1[] = ['department_ids', '=', '']; + $map2[] = ['status', '=', 1]; + $map2[] = ['', 'exp', Db::raw("FIND_IN_SET('{$department}',department_ids)")]; + $list = Db::name('FlowType')->whereOr([$map1,$map2])->fetchSql(false)->select()->toArray(); + $this->apiSuccess('获取成功', $list); + } +}