fix: implement traffic-light color warning and correct ascending sort for overdue borrow records
This commit is contained in:
@ -5,7 +5,7 @@ from app.models.transaction import TransBorrow
|
||||
from app.models.inbound.buy import StockBuy
|
||||
from app.models.inbound.semi import StockSemi
|
||||
from app.models.inbound.product import StockProduct
|
||||
from sqlalchemy import desc, func
|
||||
from sqlalchemy import desc, func, nullslast, asc
|
||||
|
||||
|
||||
class TransService:
|
||||
@ -199,7 +199,7 @@ class TransService:
|
||||
TransBorrow.sku.ilike(f'%{keyword}%') |
|
||||
TransBorrow.borrow_no.ilike(f'%{keyword}%'))
|
||||
|
||||
q = q.order_by(desc(TransBorrow.expected_return_time))
|
||||
q = q.order_by(nullslast(asc(TransBorrow.expected_return_time)))
|
||||
pagination = q.paginate(page=page, per_page=limit, error_out=False)
|
||||
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user