<?php

function ToTimestamp($time): bool|int
{
    return strtotime($time);
}

function getBlindBoxStatus($start_time, $end_time)
{
    $type_NotStarted = 1; // 未开始
    $type_progress = 2; //进行中
    $type_Done = 3; //已完成
    $status = 1;
    # 获取当前时间
    $cur_time = ToTimestamp("now");
    if ($start_time < $cur_time && $end_time > $cur_time) {
        # 进行中
        $status = $type_progress;
    } else if ($cur_time > $end_time) {
        # 已完成
        $status = $type_Done;
    }
    return $status;
}
