|
@@ -218,6 +218,10 @@ class NewCustomerViewSet(CustomModelViewSet):
|
|
|
# TODO 如果客户已放弃,再次跟踪后自动改成正常客户,同时工单状态改成正常
|
|
|
if instance.status == NewCustomer.ABANDONED:
|
|
|
data['status'] = NewCustomer.NORMAL
|
|
|
+ order = Order.objects.filter(customer=instance).first()
|
|
|
+ if order:
|
|
|
+ order.status = Order.NORMAL
|
|
|
+ order.save()
|
|
|
ser = self.serializer_class(instance, data=data, partial=True)
|
|
|
if ser.is_valid(raise_exception=True):
|
|
|
ser.save()
|
|
@@ -360,6 +364,10 @@ class ReviewViewSet(CustomModelViewSet):
|
|
|
instance.save()
|
|
|
instance.customer.status = NewCustomer.ABANDONED
|
|
|
# TODO 如果客户已下单,把工单状态改成放弃
|
|
|
+ order = Order.objects.filter(customer=instance.customer).first()
|
|
|
+ if order:
|
|
|
+ order.status = Order.ABANDONED
|
|
|
+ order.save
|
|
|
instance.customer.next_time = next_time
|
|
|
instance.customer.save()
|
|
|
except CustomError as e:
|