# coding=utf-8
from django.core.management import BaseCommand

from api.models import ServiceComment


class Command(BaseCommand):
    def handle(self, *args, **options):
        sc = ServiceComment.objects.all().values_list("id", flat=True)
        for s in sc:
            try:
                print(s)
                ss = ServiceComment.objects.get(id=s)
                ss.create_time = ss.order.last_modified
                ss.save()
                ss.order.user.doctor
                ss.is_online = False
                ss.save()
            except:
                pass

