You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
624 B
28 lines
624 B
<?php
|
|
|
|
|
|
namespace App\Admin\Common;
|
|
|
|
|
|
use Dcat\Admin\Controllers\AdminController;
|
|
|
|
class Common extends AdminController
|
|
{
|
|
|
|
/**
|
|
* 获取一个时间段内的日期
|
|
*/
|
|
public static function periodDateArr($start_time,$end_time){
|
|
$start_time = strtotime($start_time);
|
|
$end_time = strtotime($end_time);
|
|
$i=0;
|
|
$arr = [];
|
|
while ($start_time<=$end_time){
|
|
$arr[date('Y-m-d',$start_time)]=date('Y年m月d日',$start_time);
|
|
$start_time = strtotime('+1 day',$start_time);
|
|
$i++;
|
|
}
|
|
|
|
return array_reverse($arr);
|
|
}
|
|
}
|