# coding=utf-8

from django.core.management import BaseCommand
from api.models.coupon import Coupon


class Command(BaseCommand):
    """
    初始化商户数据
    python manage.py add_merchant_data
    """

    def handle(self, *args, **options):
        print('开始同步....')
        for c in Coupon.objects.all():
            c.benefit_type = c.has_threshold
            c.save()
        print('同步结束....')