From ef0a38529de5d9a6f7c3acd4b953630268e155f6 Mon Sep 17 00:00:00 2001 From: liuyebo <1515783401@qq.com> Date: Sun, 7 Jul 2024 10:47:17 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=9B=B4=E6=96=B0phhd?= =?UTF-8?q?=E7=9A=84=E5=86=99=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- photo_review/photo_review.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/photo_review/photo_review.py b/photo_review/photo_review.py index ce8dd70..f60eb0d 100644 --- a/photo_review/photo_review.py +++ b/photo_review/photo_review.py @@ -430,11 +430,11 @@ def main(): while 1: session = MysqlSession() # 查询需要识别的案子 - phhds = session.query(ZxPhhd.pk_phhd, ZxPhhd.exsuccess_flag).filter(ZxPhhd.exsuccess_flag == '1').limit( - PHHD_BATCH_SIZE).all() + phhds = session.query(ZxPhhd.pk_phhd).filter(ZxPhhd.exsuccess_flag == '1').limit(PHHD_BATCH_SIZE).all() # 将状态改为正在识别中 - for phhd in phhds: - phhd.exsuccess_flag = '2' + pk_phhd_values = [phhd.pk_phhd for phhd in phhds] + update_flag = (update(ZxPhhd).where(ZxPhhd.pk_phhd.in_(pk_phhd_values)).values(exsuccess_flag=2)) + session.execute(update_flag) session.commit() session.close() if phhds: