You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

27 lines
1.5 KiB

from sqlalchemy import or_
from utils.PageHepler import db_page_entity
from utils.apiDoc import *
@log.route('/list')
class BadUpload(Resource):
@staticmethod
def get():
data = request.args
reagentLogFilter = ReagtLog.query.order_by(ReagtLog.OperatingTime.desc())
if data.get('query') is not None:
reagentLogFilter = ReagtLog.query.join(ReagtOperatingType,
ReagtLog.OperatingType == ReagtOperatingType.OperatingCode). \
filter(or_(ReagtLog.Code.contains(data['query']),
ReagtLog.OperatingPeople.contains((data['query'])),
ReagtLog.Remark.contains(data['query']),
ReagtOperatingType.OperatingName.contains(data['query']),
ReagtLog.ReagentName.contains(data['query']),
ReagtLog.ReagentPosition.contains(data['query']),
ReagtLog.ReagentSpecification.contains(data['query']))). \
order_by(ReagtLog.OperatingTime.desc())
if data.get('index') is not None:
reagentLogFilter = ReagtLog.query.filter_by(OperatingType=data['index']). \
order_by(ReagtLog.OperatingTime.desc())
return SuccessResponse(ResultCode.SUCCESS, {'totalNumber': reagentLogFilter.count(),
'list': db_page_entity(reagentLogFilter, data, 13)}, None)