//上月一號
$startDate = date("Y-m-01", strtotime("-1 month"));
//上月最後一天
$endDate = date("Y-m-t", strtotime("-1 month"));
//上個禮拜一
$startDate = date("Y-m-d", strtotime("-2 week Monday"));
//上個禮拜天
$endDate = date("Y-m-d", strtotime("-1 week Sunday"));