新增应用接口
This commit is contained in:
parent
e2a47ec178
commit
d8bb2c26a2
|
@ -20,7 +20,6 @@ use think\facade\View;
|
||||||
|
|
||||||
class HomeIndex extends ApiController
|
class HomeIndex extends ApiController
|
||||||
{
|
{
|
||||||
|
|
||||||
protected $middleware = [
|
protected $middleware = [
|
||||||
Auth::class => ['except' => []]
|
Auth::class => ['except' => []]
|
||||||
];
|
];
|
||||||
|
|
|
@ -0,0 +1,41 @@
|
||||||
|
<?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;
|
||||||
|
use think\facade\View;
|
||||||
|
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue