进行了 backend 的重构,实验中
This commit is contained in:
@@ -52,7 +52,7 @@ from .utils import (
|
||||
|
||||
# models 集中导入
|
||||
## backend
|
||||
from backend.models import Role, Permission, RolePermission, UserRole, TixianRiTongji
|
||||
from backend.models import Role, Permission, RolePermission, UserRole, WithdrawalDailyStats
|
||||
|
||||
## users
|
||||
from users.models import (
|
||||
@@ -3329,10 +3329,10 @@ class GetWithdrawSettingsView(APIView):
|
||||
# 4. 当日已提现总额(按提现类型 leixing 1~6)
|
||||
today = date.today()
|
||||
today_totals = {i: 0.0 for i in range(1, 7)}
|
||||
records = TixianRiTongji.query.filter(riqi=today)
|
||||
records = WithdrawalDailyStats.query.filter(Date=today)
|
||||
for rec in records:
|
||||
if rec.leixing in today_totals:
|
||||
today_totals[rec.leixing] = float(rec.total_amount)
|
||||
if rec.WithdrawalType in today_totals:
|
||||
today_totals[rec.WithdrawalType] = float(rec.total_amount)
|
||||
|
||||
# 🆕 获取提现模式(自动1 / 手动2),默认2
|
||||
config = WithdrawConfig.query.filter(id=1).first()
|
||||
@@ -3358,7 +3358,7 @@ class UpdateWithdrawSettingsView(APIView):
|
||||
- 修改管事相关需要5500b
|
||||
- 修改组长相关需要5500c
|
||||
注意:修改每日总限额时,会联动影响“当日已提现总额”的显示(由前端实时计算),
|
||||
后端不直接修改 TixianRiTongji,该表由提现流程自动累加。
|
||||
后端不直接修改 WithdrawalDailyStats,该表由提现流程自动累加。
|
||||
POST /houtai/htxgtxsz
|
||||
"""
|
||||
permission_classes = []
|
||||
@@ -3491,7 +3491,7 @@ class UpdateWithdrawSettingsView(APIView):
|
||||
defaults={'mode': int(withdraw_mode)}
|
||||
)
|
||||
|
||||
# 注意:TixianRiTongji 表由提现流程自动更新,此处不直接修改
|
||||
# 注意:WithdrawalDailyStats 表由提现流程自动更新,此处不直接修改
|
||||
return Response({'code': 0, 'msg': '设置修改成功'})
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user