feat: 打手抢单大厅默认关闭假单展示,保留开关可恢复
通过 FAKE_GRAB_ORDER_POOL_ENABLED 控制,False 时仅返回真实订单,后台假单管理功能不变。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -363,6 +363,8 @@ CELERY_TASK_QUEUES = {
|
|||||||
# ==================== 定时任务时间配置 ====================
|
# ==================== 定时任务时间配置 ====================
|
||||||
# 订单超时自动结算(Celery process_expired_order / check_order_expire_task)总开关:False=彻底关闭
|
# 订单超时自动结算(Celery process_expired_order / check_order_expire_task)总开关:False=彻底关闭
|
||||||
ORDER_AUTO_SETTLEMENT_ENABLED = False
|
ORDER_AUTO_SETTLEMENT_ENABLED = False
|
||||||
|
# 打手抢单大厅假单展示:False=仅返回真实订单(后台假单管理仍可用;改 True 可恢复假单池)
|
||||||
|
FAKE_GRAB_ORDER_POOL_ENABLED = False
|
||||||
ORDER_EXPIRE_SECONDS = 48 * 60 * 60 # 48小时 = 172800秒(开关关闭时不生效)
|
ORDER_EXPIRE_SECONDS = 48 * 60 * 60 # 48小时 = 172800秒(开关关闭时不生效)
|
||||||
DAILY_TASK_HOUR = 0
|
DAILY_TASK_HOUR = 0
|
||||||
DAILY_TASK_MINUTE = 30
|
DAILY_TASK_MINUTE = 30
|
||||||
|
|||||||
@@ -97,12 +97,14 @@ class DashouDingdanHuoquView(APIView):
|
|||||||
|
|
||||||
def post(self, request):
|
def post(self, request):
|
||||||
try:
|
try:
|
||||||
|
from django.conf import settings
|
||||||
from orders.services.fake_order_pool import (
|
from orders.services.fake_order_pool import (
|
||||||
dashou_should_use_fake_pool,
|
dashou_should_use_fake_pool,
|
||||||
build_fake_order_pool_response,
|
build_fake_order_pool_response,
|
||||||
)
|
)
|
||||||
if dashou_should_use_fake_pool(request.user):
|
if getattr(settings, 'FAKE_GRAB_ORDER_POOL_ENABLED', False):
|
||||||
return build_fake_order_pool_response(request)
|
if dashou_should_use_fake_pool(request.user):
|
||||||
|
return build_fake_order_pool_response(request)
|
||||||
|
|
||||||
# 1. 获取请求参数
|
# 1. 获取请求参数
|
||||||
data = request.data
|
data = request.data
|
||||||
|
|||||||
Reference in New Issue
Block a user