|
|
|
@ -35,7 +35,35 @@ class dayValue extends Command |
|
|
|
|
|
|
|
|
|
protected function execute(Input $input, Output $output) |
|
|
|
|
{ |
|
|
|
|
$currentDate = date('Y-m-01'); // 获取当前月的第一天 |
|
|
|
|
//判断当月第一天 |
|
|
|
|
if (date('Y-m-d') === $currentDate) { |
|
|
|
|
//获取上个月时间 |
|
|
|
|
list($start, $end) = $this->getLastMonth(); |
|
|
|
|
//根据社区等级分配贡献值 |
|
|
|
|
//重置社区等级 |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public function getLastMonth() |
|
|
|
|
{ |
|
|
|
|
// 获取当前日期 |
|
|
|
|
$currentDate = date('Y-m-d'); |
|
|
|
|
// 提取当前日期的年、月和日 |
|
|
|
|
$currentYear = date('Y', strtotime($currentDate)); |
|
|
|
|
$currentMonth = date('m', strtotime($currentDate)); |
|
|
|
|
// 计算上个月的年份和月份 |
|
|
|
|
$lastMonthYear = $currentYear - 1; |
|
|
|
|
$lastMonth = $currentMonth - 1; |
|
|
|
|
// 处理特殊情况:如果上个月的月份小于1,则年份减1,月份设为12 |
|
|
|
|
if ($lastMonth < 1) { |
|
|
|
|
$lastMonthYear--; |
|
|
|
|
$lastMonth = 12; |
|
|
|
|
} |
|
|
|
|
// 获取上个月的第一天和最后一天 |
|
|
|
|
$firstDayOfLastMonth = date('Y-m-01', strtotime("$lastMonthYear-$lastMonth-01")); |
|
|
|
|
$lastDayOfLastMonth = date('Y-m-t', strtotime("$lastMonthYear-$lastMonth-01")); |
|
|
|
|
return [$firstDayOfLastMonth, $lastDayOfLastMonth]; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|