fix: lbhqltqx 使用 BossID/Order__Status 修复 FieldError

This commit is contained in:
XingQue
2026-06-26 01:55:26 +08:00
parent f38f1216ea
commit a7e51aac3f

View File

@@ -11459,12 +11459,11 @@ class LaobanJianquanView(APIView):
user = request.user # User 实例
# ========== 2. 高效查询平台订单扩展表 ==========
# 利用 PlatformOrderExt.laoban_id 索引 + Order.zhuangtai 索引
# 只查 1 条,用 exists() 实现最高性能
# BossID 为模型字段名db_column=laoban_id订单状态用 Order.Status
has_valid_order = PlatformOrderExt.query.filter(
laoban_id=user.UserUID
BossID=user.UserUID
).filter(
dingdan__zhuangtai__in=[1, 2, 3, 4, 5, 6, 7, 8]
Order__Status__in=[1, 2, 3, 4, 5, 6, 7, 8]
).only('id').exists()
if has_valid_order: