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

from hippo.tasks import update_merchant_level
import datetime

class Command(BaseCommand):
    """
    添加商户等级
    python manage.py merchant_add_level
    """

    def handle(self, *args, **options):
        today = datetime.date.today()
        end_time=datetime.datetime(today.year, today.month, 1, 0, 0, 0)
        days=today.day-end_time.day
        update_merchant_level(days)