fix: quality.py 移除未定义的 _parse_dt 调用
This commit is contained in:
@@ -65,12 +65,10 @@ async def list_quality(
|
||||
query = query.where(QualityRecord.coil_no.ilike(f"%{coil_no}%"))
|
||||
if overall_grade:
|
||||
query = query.where(QualityRecord.overall_grade == overall_grade)
|
||||
_sd = _parse_dt(start_date)
|
||||
if _sd:
|
||||
query = query.where(QualityRecord.created_at >= _sd)
|
||||
_ed = _parse_dt(end_date)
|
||||
if _ed:
|
||||
query = query.where(QualityRecord.created_at <= _ed)
|
||||
if start_date:
|
||||
query = query.where(QualityRecord.created_at >= start_date)
|
||||
if end_date:
|
||||
query = query.where(QualityRecord.created_at <= end_date)
|
||||
|
||||
total = (await db.execute(select(func.count()).select_from(query.subquery()))).scalar()
|
||||
result = await db.execute(query.offset((page - 1) * page_size).limit(page_size))
|
||||
|
||||
Reference in New Issue
Block a user