diff --git a/backend/community/serializers.py b/backend/community/serializers.py index d510ca0..647f34c 100644 --- a/backend/community/serializers.py +++ b/backend/community/serializers.py @@ -6,7 +6,7 @@ from .utils import get_current_wechat_user class ActivitySerializer(serializers.ModelSerializer): display_banner_url = serializers.ReadOnlyField() signup_form_config = serializers.SerializerMethodField() - current_signups = serializers.ReadOnlyField() + current_signups = serializers.IntegerField(read_only=True) has_signed_up = serializers.SerializerMethodField() class Meta: diff --git a/backend/shop/migrations/0028_fix_goodsid_schema.py b/backend/shop/migrations/0028_fix_goodsid_schema.py new file mode 100644 index 0000000..7e7fc16 --- /dev/null +++ b/backend/shop/migrations/0028_fix_goodsid_schema.py @@ -0,0 +1,23 @@ +# Generated by Django 6.0.1 on 2026-02-12 14:26 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('shop', '0027_wechatuser_is_star_wechatuser_title'), + ] + + operations = [ + # 1. 迁移旧数据:将 goodsid_id 的值复制到 config_id + migrations.RunSQL( + sql="UPDATE shop_order SET config_id = goodsid_id WHERE config_id IS NULL AND goodsid_id IS NOT NULL;", + reverse_sql="UPDATE shop_order SET goodsid_id = config_id WHERE goodsid_id IS NULL AND config_id IS NOT NULL;" + ), + # 2. 解除 goodsid_id 的非空限制,允许其为空(因为新代码不再写入此字段) + migrations.RunSQL( + sql="ALTER TABLE shop_order ALTER COLUMN goodsid_id DROP NOT NULL;", + reverse_sql="ALTER TABLE shop_order ALTER COLUMN goodsid_id SET NOT NULL;" + ), + ] diff --git a/frontend/src/components/CreateTopicModal.jsx b/frontend/src/components/CreateTopicModal.jsx index 143688e..6ffd63f 100644 --- a/frontend/src/components/CreateTopicModal.jsx +++ b/frontend/src/components/CreateTopicModal.jsx @@ -173,7 +173,7 @@ const CreateTopicModal = ({ visible, onClose, onSuccess, initialValues, isEditMo open={visible} onCancel={onClose} footer={null} - destroyOnClose + destroyOnHidden width={1000} centered maskClosable={false} diff --git a/frontend/src/components/LoginModal.jsx b/frontend/src/components/LoginModal.jsx index 49ee9cf..057f99c 100644 --- a/frontend/src/components/LoginModal.jsx +++ b/frontend/src/components/LoginModal.jsx @@ -64,7 +64,7 @@ const LoginModal = ({ visible, onClose, onLoginSuccess }) => { open={visible} onCancel={onClose} footer={null} - destroyOnClose + destroyOnHidden centered >