设置时间段 拆分

        $interval=$data['interval']*60;  #间隔分钟数
        $forenoon_start = strtotime($data['forenoon_start']); #开始时间
        $forenoon_end = strtotime($data['forenoon_end']);#件数时间
        $time = $forenoon_start;
        $key = 0;
        do {
            $Idata[$key]['start'] = date('H:i',$time);
            $time +=$interval;
            $Idata[$key]['end'] = date('H:i',$time);
            $Idata[$key]['type'] = 1;
            $Idata[$key]['store_id'] = $this->info['store_id'];
            $key++;
        } while ($forenoon_end > $time);

  

posted @ 2021-08-28 10:36  酷酷的城池  阅读(32)  评论(0编辑  收藏  举报