lyh 1 年之前
父節點
當前提交
52c66f9031

+ 0 - 0
apps/account/migrations/__init__.py


+ 0 - 0
apps/customer/migrations/__init__.py


+ 0 - 0
apps/foundation/migrations/__init__.py


+ 0 - 0
apps/images/migrations/__init__.py


+ 0 - 0
apps/maint_order/migrations/__init__.py


+ 0 - 0
apps/pay/migrations/__init__.py


+ 1 - 1
apps/product/filters.py

@@ -7,7 +7,7 @@ from .models import Product, ProductImg
 
 class ProductFilter(django_filters.FilterSet):
     id = django_filters.CharFilter(field_name='id')
-    type = django_filters.CharFilter(field_name='type')
+    category = django_filters.CharFilter(field_name='category')
     name = django_filters.CharFilter(field_name='name', lookup_expr='icontains')
 
     class Meta:

+ 0 - 0
apps/product_order/migrations/__init__.py


+ 0 - 0
apps/store/migrations/__init__.py


+ 0 - 0
apps/usedvehicle/migrations/__init__.py


+ 0 - 0
apps/vehicle/migrations/__init__.py


+ 0 - 0
apps/vehicle_order/migrations/__init__.py


+ 11 - 0
apps/wechat/customer/serializers.py

@@ -8,9 +8,20 @@ from apps.product_order.models import *
 from apps.base import Formater
 from utils.exceptions import CustomError
 from apps.maint_order.models import MaintOrderReserve
+from .xgj import XGJ
 
 
 class CustomerVehicleSerializer(serializers.ModelSerializer):
+    has_orders = serializers.SerializerMethodField()
+
+    def get_has_orders(self, obj):
+        abutment_xgj = Config.getConfigValue(Config.KEY_ABUTMENT_XGJ) or ''
+        if abutment_xgj and abutment_xgj == 'true':
+            res = XGJ.get_order(obj.id)
+            if len(res['data']) > 0:
+                return True
+            return False
+        return False
 
     class Meta:
         model = CustomerVehicle

+ 1 - 0
apps/wechat/customer/urls.py

@@ -17,6 +17,7 @@ urlpatterns = [
     url(r'^maint_reserve/options/$', MaintReserveOptionsView.as_view()),
     url(r'^usedvehicle/brands/$', UsedVehicleBrandsView.as_view()),
     url(r'^plan_product_order/$', PlanProductOrderView.as_view()),
+    url(r'^get_maint_order/$', GetMaintOrder.as_view()),
 ]
 
 router = SimpleRouter()

+ 1 - 2
apps/wechat/customer/views.py

@@ -279,8 +279,7 @@ class GetMaintOrder(APIView):
             except Exception as e:
                 return response_error(str(e))
             return response_ok(res)
-        return response_ok([])
-
+        return response_ok({'data': []})
 
 class CustomerVehicleViewSet(CustomModelViewSet):
     permission_classes = [IsCustomerUser, ]