fix: 回填命令兼容 FluentQuery(不用 iterator)
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -24,17 +24,17 @@ class Command(BaseCommand):
|
||||
czjilu_fixed = 0
|
||||
goumai_fixed = 0
|
||||
|
||||
member_orders = Czjilu.query.filter(leixing=1, zhuangtai=3)
|
||||
member_orders = list(Czjilu.query.filter(leixing=1, zhuangtai=3))
|
||||
with transaction.atomic():
|
||||
for order in member_orders.iterator():
|
||||
for order in member_orders:
|
||||
club_id = getattr(order, 'club_id', None)
|
||||
if _order_is_trial_like(order, club_id) and not order.is_trial:
|
||||
czjilu_fixed += 1
|
||||
if not dry_run:
|
||||
Czjilu.query.filter(dingdan_id=order.dingdan_id).update(is_trial=True)
|
||||
|
||||
goumai_rows = Huiyuangoumai.query.all()
|
||||
for row in goumai_rows.iterator():
|
||||
goumai_rows = list(Huiyuangoumai.query.all())
|
||||
for row in goumai_rows:
|
||||
if row.has_used_trial:
|
||||
continue
|
||||
if has_paid_trial_purchase(row.yonghu_id, row.huiyuan_id, row.club_id):
|
||||
|
||||
Reference in New Issue
Block a user