累死了,删除了所有跨平台逻辑,进行了表迁移
This commit is contained in:
@@ -6,7 +6,7 @@ from django.db import migrations, models
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('yonghu', '0001_initial'),
|
||||
('users', '0001_initial'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
|
||||
@@ -6,7 +6,7 @@ from django.db import migrations, models
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('yonghu', '0002_adminprofile_yaoqingma'),
|
||||
('users', '0002_adminprofile_yaoqingma'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
|
||||
@@ -6,7 +6,7 @@ from django.db import migrations, models
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('yonghu', '0003_rankingrecord'),
|
||||
('users', '0003_rankingrecord'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
|
||||
@@ -6,7 +6,7 @@ from django.db import migrations, models
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('yonghu', '0004_alter_usermain_avatar'),
|
||||
('users', '0004_alter_usermain_avatar'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
|
||||
@@ -6,7 +6,7 @@ from django.db import migrations, models
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('yonghu', '0005_officialaccountuser_usermain_unionid'),
|
||||
('users', '0005_officialaccountuser_usermain_unionid'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
|
||||
@@ -8,7 +8,7 @@ import django.db.models.deletion
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('yonghu', '0006_alter_officialaccountuser_unionid'),
|
||||
('users', '0006_alter_officialaccountuser_unionid'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
|
||||
@@ -6,7 +6,7 @@ from django.db import migrations, models
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('yonghu', '0007_userkefu'),
|
||||
('users', '0007_userkefu'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
|
||||
@@ -8,7 +8,7 @@ import django.db.models.deletion
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('yonghu', '0008_userguanshi_fenghong_erci_and_more'),
|
||||
('users', '0008_userguanshi_fenghong_erci_and_more'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
|
||||
@@ -6,7 +6,7 @@ from django.db import migrations, models
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('yonghu', '0009_userdashou_ewai_xiane_userdashou_jinritixian_jine_and_more'),
|
||||
('users', '0009_userdashou_ewai_xiane_userdashou_jinritixian_jine_and_more'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
|
||||
@@ -6,7 +6,7 @@ from django.db import migrations, models
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('yonghu', '0010_userguanshi_invite_qrcode_url'),
|
||||
('users', '0010_userguanshi_invite_qrcode_url'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
|
||||
@@ -8,7 +8,7 @@ import django.db.models.deletion
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('yonghu', '0011_usermain_shoujihao_renzheng'),
|
||||
('users', '0011_usermain_shoujihao_renzheng'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
|
||||
@@ -6,7 +6,7 @@ from django.db import migrations, models
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('yonghu', '0012_usershenheguan'),
|
||||
('users', '0012_usershenheguan'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
|
||||
@@ -6,7 +6,7 @@ from django.db import migrations, models
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('yonghu', '0013_usershenheguan_is_renzheng'),
|
||||
('users', '0013_usershenheguan_is_renzheng'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
|
||||
@@ -47,7 +47,7 @@ from utils.invitationcode_utils import CreateInvitationCode, VerifyInvitationCod
|
||||
from users.fadan_fenhong_utils import process_fadan_fenhong
|
||||
|
||||
from orders.utils import (
|
||||
update_daily_payout, update_daily_dispatch_stat,
|
||||
update_daily_payout,
|
||||
update_daily_income, settle_shangjia_order_guanshi_fenhong
|
||||
)
|
||||
from backend.utils import (
|
||||
@@ -72,7 +72,7 @@ from .tixian_shenhe_views import process_audit_collect
|
||||
from orders.models import (
|
||||
Dingdan, DingdanPingtai, DingdanShangjia, Lilubiao,
|
||||
Chufajilu, Chufatupian, Tuikuanjilu, Dashoutupian,
|
||||
PreSettlement, Fadan, FadanShensuTupian
|
||||
Fadan, FadanShensuTupian
|
||||
)
|
||||
from products.models import (
|
||||
ShangpinLeixing, Huiyuan, Huiyuangoumai, Gsfenhong, Czjilu
|
||||
@@ -6990,7 +6990,7 @@ class KefuGetOrderListView(APIView):
|
||||
|
||||
# ---------- 查询条件 ----------
|
||||
# 基础条件:平台发单 + 非跨平台
|
||||
base_q = Q(fadan_pingtai=1) & Q(is_cross=0)
|
||||
base_q = Q(fadan_pingtai=1)
|
||||
|
||||
if dingdan_id:
|
||||
q_conditions = base_q & Q(dingdan_id=dingdan_id)
|
||||
@@ -7024,7 +7024,7 @@ class KefuGetOrderListView(APIView):
|
||||
q_conditions &= Q(clkf__icontains=clkf)
|
||||
|
||||
# ---------- 统计(仅按发单平台,非跨平台) ----------
|
||||
stats = Dingdan.objects.filter(fadan_pingtai=1, is_cross=0).aggregate(
|
||||
stats = Dingdan.objects.filter(fadan_pingtai=1).aggregate(
|
||||
total_orders=Count('id'),
|
||||
completed_orders=Count('id', filter=Q(zhuangtai=3)),
|
||||
refund_orders=Count('id', filter=Q(zhuangtai=5)),
|
||||
@@ -7033,14 +7033,14 @@ class KefuGetOrderListView(APIView):
|
||||
|
||||
# ---------- 状态计数(所有状态都返回,非跨平台) ----------
|
||||
status_counts = {
|
||||
'all': Dingdan.objects.filter(fadan_pingtai=1, is_cross=0).count(),
|
||||
'1,7': Dingdan.objects.filter(fadan_pingtai=1, is_cross=0, zhuangtai__in=[1,7]).count(),
|
||||
'2': Dingdan.objects.filter(fadan_pingtai=1, is_cross=0, zhuangtai=2).count(),
|
||||
'8': Dingdan.objects.filter(fadan_pingtai=1, is_cross=0, zhuangtai=8).count(),
|
||||
'3': Dingdan.objects.filter(fadan_pingtai=1, is_cross=0, zhuangtai=3).count(),
|
||||
'4': Dingdan.objects.filter(fadan_pingtai=1, is_cross=0, zhuangtai=4).count(),
|
||||
'5': Dingdan.objects.filter(fadan_pingtai=1, is_cross=0, zhuangtai=5).count(),
|
||||
'6': Dingdan.objects.filter(fadan_pingtai=1, is_cross=0, zhuangtai=6).count(),
|
||||
'all': Dingdan.objects.filter(fadan_pingtai=1).count(),
|
||||
'1,7': Dingdan.objects.filter(fadan_pingtai=1, zhuangtai__in=[1,7]).count(),
|
||||
'2': Dingdan.objects.filter(fadan_pingtai=1, zhuangtai=2).count(),
|
||||
'8': Dingdan.objects.filter(fadan_pingtai=1, zhuangtai=8).count(),
|
||||
'3': Dingdan.objects.filter(fadan_pingtai=1, zhuangtai=3).count(),
|
||||
'4': Dingdan.objects.filter(fadan_pingtai=1, zhuangtai=4).count(),
|
||||
'5': Dingdan.objects.filter(fadan_pingtai=1, zhuangtai=5).count(),
|
||||
'6': Dingdan.objects.filter(fadan_pingtai=1, zhuangtai=6).count(),
|
||||
}
|
||||
|
||||
# ---------- 分页查询 ----------
|
||||
@@ -7155,7 +7155,7 @@ class KefuGetShangjiaOrderListView(APIView):
|
||||
|
||||
# ---------- 查询条件 ----------
|
||||
# 基础条件:商家发单 + 非跨平台
|
||||
base_q = Q(fadan_pingtai=2) & Q(is_cross=0)
|
||||
base_q = Q(fadan_pingtai=2)
|
||||
|
||||
if dingdan_id:
|
||||
q_conditions = base_q & Q(dingdan_id=dingdan_id)
|
||||
@@ -7193,7 +7193,7 @@ class KefuGetShangjiaOrderListView(APIView):
|
||||
).values_list('yonghuid', flat=True))
|
||||
|
||||
# ---------- 统计(仅按发单平台,非跨平台) ----------
|
||||
stats = Dingdan.objects.filter(fadan_pingtai=2, is_cross=0).aggregate(
|
||||
stats = Dingdan.objects.filter(fadan_pingtai=2).aggregate(
|
||||
total_orders=Count('id'),
|
||||
completed_orders=Count('id', filter=Q(zhuangtai=3)),
|
||||
refund_orders=Count('id', filter=Q(zhuangtai=5)),
|
||||
@@ -7202,14 +7202,14 @@ class KefuGetShangjiaOrderListView(APIView):
|
||||
|
||||
# ---------- 状态计数(所有状态都返回,非跨平台) ----------
|
||||
status_counts = {
|
||||
'all': Dingdan.objects.filter(fadan_pingtai=2, is_cross=0).count(),
|
||||
'1,7': Dingdan.objects.filter(fadan_pingtai=2, is_cross=0, zhuangtai__in=[1,7]).count(),
|
||||
'2': Dingdan.objects.filter(fadan_pingtai=2, is_cross=0, zhuangtai=2).count(),
|
||||
'8': Dingdan.objects.filter(fadan_pingtai=2, is_cross=0, zhuangtai=8).count(),
|
||||
'3': Dingdan.objects.filter(fadan_pingtai=2, is_cross=0, zhuangtai=3).count(),
|
||||
'4': Dingdan.objects.filter(fadan_pingtai=2, is_cross=0, zhuangtai=4).count(),
|
||||
'5': Dingdan.objects.filter(fadan_pingtai=2, is_cross=0, zhuangtai=5).count(),
|
||||
'6': Dingdan.objects.filter(fadan_pingtai=2, is_cross=0, zhuangtai=6).count(),
|
||||
'all': Dingdan.objects.filter(fadan_pingtai=2).count(),
|
||||
'1,7': Dingdan.objects.filter(fadan_pingtai=2, zhuangtai__in=[1,7]).count(),
|
||||
'2': Dingdan.objects.filter(fadan_pingtai=2, zhuangtai=2).count(),
|
||||
'8': Dingdan.objects.filter(fadan_pingtai=2, zhuangtai=8).count(),
|
||||
'3': Dingdan.objects.filter(fadan_pingtai=2, zhuangtai=3).count(),
|
||||
'4': Dingdan.objects.filter(fadan_pingtai=2, zhuangtai=4).count(),
|
||||
'5': Dingdan.objects.filter(fadan_pingtai=2, zhuangtai=5).count(),
|
||||
'6': Dingdan.objects.filter(fadan_pingtai=2, zhuangtai=6).count(),
|
||||
}
|
||||
|
||||
# ---------- 分页查询 ----------
|
||||
|
||||
Reference in New Issue
Block a user