diff --git a/api/api_v1/endpoints/interview.py b/api/api_v1/endpoints/interview.py index 1fb3667..d754d45 100644 --- a/api/api_v1/endpoints/interview.py +++ b/api/api_v1/endpoints/interview.py @@ -934,7 +934,10 @@ async def get_job( job_list['job_num'] = i['job_num'] # 目标招聘人数 job_list['now_job_num'] = i['now_job_num'] # 对应职位的入职人数 job_list['hou_num'] = hou_num[0]['nu'] # 候选人总数 + job_list['creat_time'] = i['creat_time'] # 创建职位的时间 job.append(job_list) + # 按创建职位的最新时间排序 + job.sort(key=lambda item: item['creat_time'], reverse=True) if data_in != None: data = { 'start_num': nums, diff --git a/schemas/jobs.py b/schemas/jobs.py index b2b6d3a..4b26e43 100644 --- a/schemas/jobs.py +++ b/schemas/jobs.py @@ -97,7 +97,7 @@ class Ins_Job(BaseModel): hr_name: List[dict] # 用人经理 interview: List[dict] # 面试官 end_time: str # 结束招聘时间 - + creat_time:str=str(datetime.now()).split('.')[0] # 职位创建时间 class Find_job(BaseModel): job_id: str # 职位的唯一id