From c713ec9a50de921663967884af4a825040c11981 Mon Sep 17 00:00:00 2001 From: aaron <> Date: Sat, 15 Feb 2025 18:05:00 +0800 Subject: [PATCH] update --- app/api/endpoints/merchant.py | 12 +----------- app/api/endpoints/wechat.py | 8 ++++---- 2 files changed, 5 insertions(+), 15 deletions(-) diff --git a/app/api/endpoints/merchant.py b/app/api/endpoints/merchant.py index 5160114..a31da83 100644 --- a/app/api/endpoints/merchant.py +++ b/app/api/endpoints/merchant.py @@ -185,17 +185,7 @@ async def list_merchants( merchants = query.offset(skip).limit(limit).all() - # 获取商家在线买单数量 merchant_ids = [m[0].id for m in merchants] - pay_order_counts = dict( - db.query( - MerchantPayOrderDB.merchant_id, - func.count(MerchantPayOrderDB.id).label('count') - ).filter( - MerchantPayOrderDB.merchant_id.in_(merchant_ids) - ).group_by(MerchantPayOrderDB.merchant_id).all() - ) - # 获取商家最新或限购商品 merchant_products = {} for merchant_id in merchant_ids: @@ -233,7 +223,7 @@ async def list_merchants( "category_name": m[1], "user_phone": m[2], "user_nickname": m[3], - "online_pay_count": pay_order_counts.get(m[0].id, 0), + "gift_points_rate_text": f"赠送蜂蜜 {m[0].pay_gift_points_rate * 10}%", "featured_product": merchant_products.get(m[0].id), "distance": round(m[4]) if longitude is not None and latitude is not None else None } for m in merchants] diff --git a/app/api/endpoints/wechat.py b/app/api/endpoints/wechat.py index aeeb1ca..49caa96 100644 --- a/app/api/endpoints/wechat.py +++ b/app/api/endpoints/wechat.py @@ -249,10 +249,10 @@ async def payment_notify( if trade_state_desc == "支付成功": - if order.gift_points > 0: - # 添加积分 - point_manager = PointManager(db) - point_manager.add_points(order.user_id, order.gift_points, PointRecordType.CONSUME_RETURN, f"团购订单奖励", order.order_id) + # if order.gift_points > 0: + # # 添加积分 + # point_manager = PointManager(db) + # point_manager.add_points(order.user_id, order.gift_points, PointRecordType.CONSUME_RETURN, f"团购订单奖励", order.order_id) # 更新订单状态 order.pay_status = True