From 1f07e64cd68e1fdb072a07a48c9880913be0b43b Mon Sep 17 00:00:00 2001 From: yaooo <272523191@qq.com> Date: Thu, 2 Nov 2023 15:45:15 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=97=B6=E9=97=B4=E6=88=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/controller/HomeIndex.php | 1 + app/api/controller/NoteIndex.php | 4 ++++ app/api/controller/OaApprove.php | 4 ++++ app/api/controller/UserDepartment.php | 10 +++++++++- 4 files changed, 18 insertions(+), 1 deletion(-) diff --git a/app/api/controller/HomeIndex.php b/app/api/controller/HomeIndex.php index 83362c0..a325b0f 100644 --- a/app/api/controller/HomeIndex.php +++ b/app/api/controller/HomeIndex.php @@ -28,6 +28,7 @@ class HomeIndex extends ApiController { $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(); + $userInfo['entry_time'] = date('Y-m-d', $userInfo['entry_time']); $this->apiSuccess('获取成功', $userInfo); } diff --git a/app/api/controller/NoteIndex.php b/app/api/controller/NoteIndex.php index 7c22c0e..dfb4cf1 100644 --- a/app/api/controller/NoteIndex.php +++ b/app/api/controller/NoteIndex.php @@ -55,6 +55,10 @@ class NoteIndex extends ApiController $this->apiError('公告不存在'); } $note['cate_title'] = Db::name('NoteCate')->where(['id' => $note['cate_id']])->value('title'); + $note['start_time'] = date('Y-m-d H:i:s', $note['start_time']); + $note['end_time'] = date('Y-m-d H:i:s', $note['end_time']); + $note['create_time'] = date('Y-m-d H:i:s', $note['create_time']); + $note['update_time'] = date('Y-m-d H:i:s', $note['update_time']); $this->apiSuccess('获取成功', $note); } diff --git a/app/api/controller/OaApprove.php b/app/api/controller/OaApprove.php index 8f597f8..bc3c928 100644 --- a/app/api/controller/OaApprove.php +++ b/app/api/controller/OaApprove.php @@ -36,6 +36,10 @@ class OaApprove extends ApiController $map2[] = ['status', '=', 1]; $map2[] = ['', 'exp', Db::raw("FIND_IN_SET('{$department}',department_ids)")]; $list = Db::name('FlowType')->whereOr([$map1,$map2])->fetchSql(false)->select()->toArray(); + foreach($list as $k=>$v) { + $list[$k]['create_time'] = date('Y-m-d H:i:s', $v['create_time']); + $list[$k]['update_time'] = date('Y-m-d H:i:s', $v['update_time']); + } $this->apiSuccess('获取成功', $list); } diff --git a/app/api/controller/UserDepartment.php b/app/api/controller/UserDepartment.php index 402efb3..2327af8 100644 --- a/app/api/controller/UserDepartment.php +++ b/app/api/controller/UserDepartment.php @@ -30,13 +30,21 @@ class UserDepartment extends ApiController $param = get_params(); if (!empty($param['tree']) && $param['tree'] == 1) { $list = set_recursion(get_department()); + foreach($list as $k=>$v) { + $list[$k]['create_time'] = date('Y-m-d H:i:s', $v['create_time']); + $list[$k]['update_time'] = date('Y-m-d H:i:s', $v['update_time']); + } } else { $cate = Db::name('Department') ->field('d.*,a.name as leader') ->alias('d') ->join('Admin a', 'a.id = d.leader_id', 'LEFT') ->order('d.sort desc,d.id asc') - ->select(); + ->select()->toArray(); + foreach($cate as $k=>$v) { + $cate[$k]['create_time'] = date('Y-m-d H:i:s', $v['create_time']); + $cate[$k]['update_time'] = date('Y-m-d H:i:s', $v['update_time']); + } $list = generateTree($cate); } $this->apiSuccess('获取成功', $list);