<?php
namespace Biz\Datetime;
/**
 * basetime
 */
class Datedays extends BaseTime {
	/**
	 * 时间信息获取
	 * @var string
	 */
	public function parseTime($params){
		$res = $this->GetTimesDay($params[0]);
		return $res;
	}

    //获取指定日期起始时间:日
    public function GetTimesDay($type){
        if($type == 'pre'){
            $res['start'] = date('Y-m-d 00:00:00',time()-3600*24);
            $res['end'] = date('Y-m-d 23:59:59',time()-3600*24);
        }else if($type=='cur'){
            $res['start'] = date('Y-m-d 00:00:00');
            $res['end'] = date('Y-m-d 23:59:59');
        }else{
            $res['start'] = date('Y-m-d 00:00:00',time()+3600*24);
            $res['end'] = date('Y-m-d 23:59:59',time()+3600*24);
        }
        return $res;
    }

}