feat: 打手抢单大厅默认关闭假单展示,保留开关可恢复

通过 FAKE_GRAB_ORDER_POOL_ENABLED 控制,False 时仅返回真实订单,后台假单管理功能不变。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
XingQue
2026-07-13 15:29:27 +08:00
parent 80cca803f8
commit ce8bda52d3
2 changed files with 6 additions and 2 deletions

View File

@@ -363,6 +363,8 @@ CELERY_TASK_QUEUES = {
# ==================== 定时任务时间配置 ====================
# 订单超时自动结算Celery process_expired_order / check_order_expire_task总开关False=彻底关闭
ORDER_AUTO_SETTLEMENT_ENABLED = False
# 打手抢单大厅假单展示False=仅返回真实订单(后台假单管理仍可用;改 True 可恢复假单池)
FAKE_GRAB_ORDER_POOL_ENABLED = False
ORDER_EXPIRE_SECONDS = 48 * 60 * 60 # 48小时 = 172800秒开关关闭时不生效
DAILY_TASK_HOUR = 0
DAILY_TASK_MINUTE = 30

View File

@@ -97,12 +97,14 @@ class DashouDingdanHuoquView(APIView):
def post(self, request):
try:
from django.conf import settings
from orders.services.fake_order_pool import (
dashou_should_use_fake_pool,
build_fake_order_pool_response,
)
if dashou_should_use_fake_pool(request.user):
return build_fake_order_pool_response(request)
if getattr(settings, 'FAKE_GRAB_ORDER_POOL_ENABLED', False):
if dashou_should_use_fake_pool(request.user):
return build_fake_order_pool_response(request)
# 1. 获取请求参数
data = request.data