对于没有图片的案子(照片同步出现问题)不再做处理

This commit is contained in:
2024-08-07 16:15:03 +08:00
parent 198e833602
commit d5e17f160f
2 changed files with 10 additions and 4 deletions

View File

@@ -278,7 +278,11 @@ def photo_review(pk_phhd):
def main():
while 1:
session = MysqlSession()
phhds = session.query(ZxPhhd.pk_phhd).filter(ZxPhhd.exsuccess_flag == '1').limit(PHHD_BATCH_SIZE).all()
phhds = (session.query(ZxPhhd.pk_phhd)
.join(ZxPhrec, ZxPhhd.pk_phhd == ZxPhrec.pk_phhd, isouter=True)
.filter(ZxPhhd.exsuccess_flag == "1")
.filter(ZxPhrec.pk_phrec.isnot(None))
.distinct().limit(PHHD_BATCH_SIZE).all())
# 将状态改为正在识别中
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))