更新时间戳

This commit is contained in:
yaooo 2023-11-02 15:45:15 +08:00
parent e03d610064
commit 1f07e64cd6
4 changed files with 18 additions and 1 deletions

View File

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

View File

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

View File

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

View File

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