41 lines
1.1 KiB
PHP
41 lines
1.1 KiB
PHP
|
<?php
|
||
|
/**
|
||
|
* @copyright Copyright (c) 2021 勾股工作室
|
||
|
* @license https://opensource.org/licenses/GPL-3.0
|
||
|
* @link https://www.gougucms.com
|
||
|
*/
|
||
|
|
||
|
declare (strict_types = 1);
|
||
|
|
||
|
namespace app\api\controller;
|
||
|
|
||
|
use app\api\ApiController;
|
||
|
use app\api\middleware\Auth;
|
||
|
use app\note\model\Note as NoteList;
|
||
|
use app\home\model\AdminLog;
|
||
|
use app\user\validate\AdminCheck;
|
||
|
use think\exception\ValidateException;
|
||
|
use think\facade\Db;
|
||
|
|
||
|
class OaApprove extends ApiController
|
||
|
{
|
||
|
protected $middleware = [
|
||
|
Auth::class => ['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);
|
||
|
}
|
||
|
}
|