fix(monitor physical):add before in last
This commit is contained in:
@@ -33,7 +33,13 @@ class PhysicalProgressRepository(BaseRepository):
|
||||
return {}
|
||||
|
||||
async def last_record(self, _inp: LastRecord):
|
||||
send = {'month': {}, 'three_month': {}}
|
||||
send = {'month': {}, 'three_month': {}, 'before':{}}
|
||||
before = await use_collection(TaskEnv.CLN_MONITOR_PYSICAL).find({
|
||||
'project_id': _inp.project_id,
|
||||
'date_at': {'$lt': _inp.date_at}
|
||||
}).sort("$natural", -1).to_list(None)
|
||||
if before:
|
||||
send['before'] = before[0]
|
||||
last = await self.search_last(TaskEnv.CLN_MONITOR_PYSICAL, _inp, 35, 25)
|
||||
if last:
|
||||
send['month'] = last
|
||||
|
||||
Reference in New Issue
Block a user